This commit is contained in:
syuilo 2020-09-05 13:09:34 +09:00
parent 138c9868e8
commit deb3df1536
67 changed files with 229 additions and 229 deletions

View file

@ -295,7 +295,7 @@ export default defineComponent({
watch: {
lang() {
const dialog = this.$root.showDialog({
const dialog = this.$store.dispatch('showDialog', {
type: 'waiting',
iconOnly: true
});
@ -306,7 +306,7 @@ export default defineComponent({
.then(() => location.reload())
.catch(() => {
dialog.close();
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
iconOnly: true,
autoClose: true

View file

@ -85,7 +85,7 @@ export default defineComponent({
try {
ast = parse(this.script);
} catch (e) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: 'Syntax error :('
});
@ -93,7 +93,7 @@ export default defineComponent({
}
const meta = AiScript.collectMetadata(ast);
if (meta == null) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: 'No metadata found :('
});
@ -101,7 +101,7 @@ export default defineComponent({
}
const data = meta.get(null);
if (data == null) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: 'No metadata found :('
});
@ -109,7 +109,7 @@ export default defineComponent({
}
const { name, version, author, description, permissions, config } = data;
if (name == null || version == null || author == null) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: 'Required property not found :('
});
@ -142,7 +142,7 @@ export default defineComponent({
ast: serialize(ast)
});
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
@ -154,7 +154,7 @@ export default defineComponent({
uninstall() {
this.$store.commit('deviceUser/uninstallPlugin', this.selectedPluginId);
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});

View file

@ -61,7 +61,7 @@ export default defineComponent({
methods: {
async addItem() {
const menu = Object.keys(this.menuDef).filter(k => !this.$store.state.deviceUser.menu.includes(k));
const { canceled, result: item } = await this.$root.showDialog({
const { canceled, result: item } = await this.$store.dispatch('showDialog', {
type: null,
title: this.$t('addItem'),
select: {

View file

@ -194,7 +194,7 @@ export default defineComponent({
copyThemeCode() {
copyToClipboard(this.selectedThemeCode);
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
@ -206,21 +206,21 @@ export default defineComponent({
try {
theme = JSON5.parse(code);
} catch (e) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('_theme.invalid')
});
return false;
}
if (!validateTheme(theme)) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('_theme.invalid')
});
return false;
}
if (this.$store.state.device.themes.some(t => t.id === theme.id)) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'info',
text: this.$t('_theme.alreadyInstalled')
});
@ -242,7 +242,7 @@ export default defineComponent({
this.$store.commit('device/set', {
key: 'themes', value: themes
});
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
text: this.$t('_theme.installed', { name: theme.name })
});
@ -254,7 +254,7 @@ export default defineComponent({
this.$store.commit('device/set', {
key: 'themes', value: themes
});
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});