仅 runcode 才保存历史

This commit is contained in:
fofolee
2022-04-19 21:45:47 +08:00
parent 3e6fa8364c
commit 6cfd054767
3 changed files with 12 additions and 16 deletions

View File

@@ -86,21 +86,11 @@ export default defineComponent({
this.$router.push(enter.code);
},
outPlugin() {
this.saveProfile();
this.$router.push("/");
window.temporaryStoreSoldOut();
},
saveProfile() {
let commandEditor = this.$refs.view.$refs.commandEditor;
if (commandEditor && commandEditor.action.type !== "edit") {
let command = _.cloneDeep(commandEditor.quickcommandInfo);
command.cursorPosition = commandEditor.$refs.editor.getCursorPosition();
this.profile.codeHistory[commandEditor.action.type] = command;
}
this.utools.putDB(
_.cloneDeep(this.profile),
this.utools.DBPRE.CFG + "preferences"
);
this.$router.push("/");
},
runCronTask(featureCode, cronExp) {
this.cronJobs[featureCode] = Cron(cronExp, () => {