summaryrefslogtreecommitdiff
path: root/src/client/app/store.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-05-18 15:34:38 +0900
committerGitHub <noreply@github.com>2018-05-18 15:34:38 +0900
commit0d0c45a4cfa541c2d2d4abc2a332ee06ff8e89ef (patch)
treebb848206ce941fdf784418ad18060522d51eec18 /src/client/app/store.ts
parentNew translations ja.yml (Korean) (diff)
parent2.10.0 (diff)
downloadmisskey-0d0c45a4cfa541c2d2d4abc2a332ee06ff8e89ef.tar.gz
misskey-0d0c45a4cfa541c2d2d4abc2a332ee06ff8e89ef.tar.bz2
misskey-0d0c45a4cfa541c2d2d4abc2a332ee06ff8e89ef.zip
Merge branch 'master' into l10n_master
Diffstat (limited to 'src/client/app/store.ts')
-rw-r--r--src/client/app/store.ts41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/client/app/store.ts b/src/client/app/store.ts
index 0bdfdef6a0..1f1189054d 100644
--- a/src/client/app/store.ts
+++ b/src/client/app/store.ts
@@ -3,6 +3,7 @@ import MiOS from './mios';
const defaultSettings = {
home: [],
+ mobileHome: [],
fetchOnScroll: true,
showMaps: true,
showPostFormOnTopOfTl: false,
@@ -23,10 +24,15 @@ export default (os: MiOS) => new Vuex.Store({
}],
state: {
+ indicate: false,
uiHeaderHeight: 0
},
mutations: {
+ indicate(state, x) {
+ state.indicate = x;
+ },
+
setUiHeaderHeight(state, height) {
state.uiHeaderHeight = height;
}
@@ -58,6 +64,25 @@ export default (os: MiOS) => new Vuex.Store({
addHomeWidget(state, widget) {
state.data.home.unshift(widget);
+ },
+
+ setMobileHome(state, data) {
+ state.data.mobileHome = data;
+ },
+
+ setMobileHomeWidget(state, x) {
+ const w = state.data.mobileHome.find(w => w.id == x.id);
+ if (w) {
+ w.data = x.data;
+ }
+ },
+
+ addMobileHomeWidget(state, widget) {
+ state.data.mobileHome.unshift(widget);
+ },
+
+ removeMobileHomeWidget(state, widget) {
+ state.data.mobileHome = state.data.mobileHome.filter(w => w.id != widget.id);
}
},
@@ -85,6 +110,22 @@ export default (os: MiOS) => new Vuex.Store({
os.api('i/update_home', {
home: ctx.state.data.home
});
+ },
+
+ addMobileHomeWidget(ctx, widget) {
+ ctx.commit('addMobileHomeWidget', widget);
+
+ os.api('i/update_mobile_home', {
+ home: ctx.state.data.mobileHome
+ });
+ },
+
+ removeMobileHomeWidget(ctx, widget) {
+ ctx.commit('removeMobileHomeWidget', widget);
+
+ os.api('i/update_mobile_home', {
+ home: ctx.state.data.mobileHome.filter(w => w.id != widget.id)
+ });
}
}
}