デッキの状態を同期できるように

This commit is contained in:
syuilo 2019-06-21 13:06:47 +09:00
parent 18184441f1
commit 6136f6f33a
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
5 changed files with 48 additions and 8 deletions

View file

@ -36,6 +36,7 @@ const defaultSettings = {
disableAnimatedMfm: false,
homeProfiles: {},
mobileHomeProfiles: {},
deckProfiles: {},
};
const defaultDeviceSettings = {
@ -44,6 +45,7 @@ const defaultDeviceSettings = {
mobileHomeProfile: null,
mobileHome: [],
deck: null,
deckProfile: null,
deckMode: false,
deckColumnAlign: 'center',
deckColumnWidth: 'normal',
@ -390,7 +392,20 @@ export default (os: MiOS) => new Vuex.Store({
name: 'mobileHomeProfiles',
value: profiles
});
}
},
updateDeckProfile(ctx) {
const profiles = ctx.state.deckProfiles;
profiles[ctx.rootState.device.deckProfile] = ctx.rootState.device.deck;
ctx.commit('set', {
key: 'deckProfiles',
value: profiles
});
os.api('i/update-client-setting', {
name: 'deckProfiles',
value: profiles
});
},
}
}
}