misc: storedActionHelper 저장 키에 map, unit 지정

This commit is contained in:
2022-03-23 20:12:59 +09:00
parent b8542b6bce
commit ef911ba5cc
5 changed files with 12 additions and 5 deletions
+2
View File
@@ -392,6 +392,8 @@ export default defineComponent({
autorun_limit: undefined,
officerLevel: undefined,
commandList: undefined,
mapName: undefined,
unitSet: undefined,
});
async function reloadTable(): Promise<void> {
+2
View File
@@ -223,6 +223,8 @@ export type ChiefResponse = {
category: string;
values: CommandItem[];
}[];
mapName: string,
unitSet: string,
};
+3 -4
View File
@@ -1,5 +1,4 @@
import type { TurnObj } from '@/defs';
import { clone } from 'lodash';
import { ref } from 'vue';
@@ -9,9 +8,9 @@ export class StoredActionsHelper {
public readonly recentActionsKey: string;
public readonly storedActionsKey: string;
constructor(protected serverNick: string, protected type: 'general' | 'nation', protected maxRecent = 10) {
this.recentActionsKey = `${serverNick}_${type}RecentActions`;
this.storedActionsKey = `${serverNick}_${type}StoredActions`;
constructor(protected serverNick: string, protected type: 'general' | 'nation', protected mapName: string, protected unitSet: string, protected maxRecent = 10) {
this.recentActionsKey = `${serverNick}_${mapName}_${unitSet}_${type}RecentActions`;
this.storedActionsKey = `${serverNick}_${mapName}_${unitSet}_${type}StoredActions`;
this.loadRecentActions();
this.loadStoredActions();
}