feat: centralize all screen related callbacks in useScreen
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import Buttons from "./Buttons.vue";
|
||||
|
||||
const { onRender } = useScreen();
|
||||
|
||||
const { assets } = useAssets();
|
||||
const { close, state } = useConfirmationModal();
|
||||
|
||||
@@ -23,7 +25,7 @@ const handleActivateB = () => {
|
||||
close();
|
||||
};
|
||||
|
||||
useRender((ctx) => {
|
||||
onRender((ctx) => {
|
||||
if (!state.value.isVisible) return;
|
||||
|
||||
ctx.beginPath();
|
||||
@@ -39,7 +41,7 @@ useRender((ctx) => {
|
||||
ctx.fillStyle = "#ffffff";
|
||||
|
||||
fillTextCentered(ctx, state.value.text, BG_X, TEXT_Y, BG_WIDTH);
|
||||
});
|
||||
}, 100);
|
||||
|
||||
onUnmounted(() => {
|
||||
close();
|
||||
|
||||
Reference in New Issue
Block a user