summaryrefslogtreecommitdiff
path: root/packages/frontend/src/widgets/WidgetButton.vue
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/widgets/WidgetButton.vue')
-rw-r--r--packages/frontend/src/widgets/WidgetButton.vue12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/frontend/src/widgets/WidgetButton.vue b/packages/frontend/src/widgets/WidgetButton.vue
index 4afe735a22..e88a960f87 100644
--- a/packages/frontend/src/widgets/WidgetButton.vue
+++ b/packages/frontend/src/widgets/WidgetButton.vue
@@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
import { Interpreter, Parser } from '@syuilo/aiscript';
import { useWidgetPropsManager } from './widget.js';
import type { WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget.js';
-import type { GetFormResultType } from '@/utility/form.js';
+import type { FormWithDefault, GetFormResultType } from '@/utility/form.js';
import * as os from '@/os.js';
import { aiScriptReadline, createAiScriptEnv } from '@/aiscript/api.js';
import { $i } from '@/i.js';
@@ -25,19 +25,19 @@ const name = 'button';
const widgetPropsDef = {
label: {
- type: 'string' as const,
+ type: 'string',
default: 'BUTTON',
},
colored: {
- type: 'boolean' as const,
+ type: 'boolean',
default: true,
},
script: {
- type: 'string' as const,
+ type: 'string',
multiline: true,
default: 'Mk:dialog("hello" "world")',
},
-};
+} satisfies FormWithDefault;
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
@@ -81,7 +81,7 @@ const run = async () => {
} catch (err) {
os.alert({
type: 'error',
- text: err,
+ text: err instanceof Error ? err.message : String(err),
});
}
};