Skip to content

Commit

Permalink
remove update checker
Browse files Browse the repository at this point in the history
  • Loading branch information
storyxc committed Jun 19, 2023
1 parent 62aa45a commit 4badd9c
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 38 deletions.
3 changes: 0 additions & 3 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ declare module 'vue' {
export interface GlobalComponents {
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElTag: typeof import('element-plus/es')['ElTag']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Expand Down
12 changes: 0 additions & 12 deletions electron/ipcMainHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,6 @@ export default {
fs.writeFileSync(preferencesFilePath, JSON.stringify(preferencesObj));
return true;
});

/**
* @description 切换更新频率
*/
ipcMain.handle("CHANGE-UPDATE-FREQUENCY", async (event, updateFrequency: string): Promise<boolean> => {
const preferences = fs.readFileSync(preferencesFilePath, "utf-8");
const preferencesObj = JSON.parse(preferences);
preferencesObj.updateFrequency = updateFrequency;
fs.writeFileSync(preferencesFilePath, JSON.stringify(preferencesObj));
return true;
});

},

}
Expand Down
1 change: 0 additions & 1 deletion electron/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ contextBridge.exposeInMainWorld("api", {
addTodoItem: (todoItemStr: string) => ipcRenderer.invoke("ADD-TODO-ITEM", todoItemStr),
toggleAutoLaunch: (enabled: boolean) => ipcRenderer.invoke("TOGGLE-AUTO-LAUNCH", enabled),
getPreferences: () => ipcRenderer.invoke("GET-PREFERENCES"),
changeUpdateFrequency: (frequency: string) => ipcRenderer.invoke("CHANGE-UPDATE-FREQUENCY", frequency),
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ido",
"private": true,
"version": "0.0.1",
"version": "0.0.2",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build && electron-builder",
Expand Down
1 change: 0 additions & 1 deletion src/universal/electron/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ export interface ElectronAPI {
addTodoItem: (todoItemEntityStr: string) => Promise<boolean>;
toggleAutoLaunch: (enabled: boolean) => Promise<boolean>;
getPreferences: () => Promise<Preferences>;
changeUpdateFrequency: (frequency: string) => Promise<boolean>;
}
8 changes: 0 additions & 8 deletions src/universal/todo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,4 @@ interface Preferences {
updateFrequency: string;
}

const UpdateFrequency = {
Never: "never",
Daily: "daily",
Weekly: "weekly",
Manually: "manually",
}

export type { TodoItemEntity, TodoList, Preferences };
export { UpdateFrequency };
12 changes: 0 additions & 12 deletions src/views/PreferenceView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@
<el-form @submit.prevent>
<el-checkbox v-model="preferences.startAtLogin" @change="handleStartAtLoginChange">Launch on system startup
</el-checkbox>
<el-form-item label="Update ">
<el-select v-model="preferences.updateFrequency" placeholder="Select" size="small"
@change="handleUpdateFrequencyChange">
<el-option v-for="(value, key) in UpdateFrequency" :key="key" :label="key" :value="value"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</template>
<script setup lang="ts">
import { onMounted } from "vue";
import { UpdateFrequency } from "@/universal/todo";

const preferences = reactive({
startAtLogin: false,
Expand All @@ -32,10 +24,6 @@ const handleStartAtLoginChange = async (enabled: boolean) => {
await window.api.toggleAutoLaunch(enabled)
}

const handleUpdateFrequencyChange = async (updateFrequency: string) => {
await window.api.changeUpdateFrequency(updateFrequency)
}


</script>
<style scoped lang="less">
Expand Down

0 comments on commit 4badd9c

Please sign in to comment.