summaryrefslogtreecommitdiff
path: root/src/client/widgets
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2020-08-09 15:51:02 +0900
committerGitHub <noreply@github.com>2020-08-09 15:51:02 +0900
commit69d9aa71f25ab06d8024b04ce341909425d053d6 (patch)
tree868ac53c1de7ea628a464ab277ee3aa573fdb24b /src/client/widgets
parent:v: (diff)
downloadmisskey-69d9aa71f25ab06d8024b04ce341909425d053d6.tar.gz
misskey-69d9aa71f25ab06d8024b04ce341909425d053d6.tar.bz2
misskey-69d9aa71f25ab06d8024b04ce341909425d053d6.zip
Full view mode (#6636)
* wuip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update folder.vue * wip * Update size.ts * wip * wip * Update index.vue * wip
Diffstat (limited to 'src/client/widgets')
-rw-r--r--src/client/widgets/define.ts17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/client/widgets/define.ts b/src/client/widgets/define.ts
index 107045bf4b..50c9b10e81 100644
--- a/src/client/widgets/define.ts
+++ b/src/client/widgets/define.ts
@@ -8,7 +8,8 @@ export default function <T extends Form>(data: {
return Vue.extend({
props: {
widget: {
- type: Object
+ type: Object,
+ required: false
},
isCustomizeMode: {
type: Boolean,
@@ -16,19 +17,13 @@ export default function <T extends Form>(data: {
}
},
- data() {
- return {
- bakedOldProps: null
- };
- },
-
computed: {
id(): string {
- return this.widget.id;
+ return this.widget ? this.widget.id : null;
},
props(): Record<string, any> {
- return this.widget.data;
+ return this.widget ? this.widget.data : {};
}
},
@@ -67,7 +62,9 @@ export default function <T extends Form>(data: {
},
save() {
- this.$store.commit('deviceUser/updateWidget', this.widget);
+ if (this.widget) {
+ this.$store.commit('deviceUser/updateWidget', this.widget);
+ }
}
}
});