Skip to content

Commit

Permalink
更新本地配置覆盖逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperzlib committed Jul 4, 2024
1 parent 911774a commit de14b7d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions frontend/src/pages/Controller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,20 @@ const initWebSocket = async () => {
wsClient.on('configUpdated', (config) => {
receivedConfig = true;
gameConfig.value = config;
oldConfig = config;
// 屏蔽保存提示
receivedConfig = true;
nextTick(() => {
receivedConfig = false;
});
if (state.showConfigSavePrompt) {
// 当前有配置未保存,不更新配置,只替换旧配置
oldConfig = config;
} else {
// 覆盖本地配置
gameConfig.value = config;
oldConfig = config;
// 屏蔽保存提示
receivedConfig = true;
nextTick(() => {
receivedConfig = false;
});
}
});
wsClient.connect();
Expand Down

0 comments on commit de14b7d

Please sign in to comment.