mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
refactor: prompts sync
This commit is contained in:
16
src-tauri/src/assets/core.js
vendored
16
src-tauri/src/assets/core.js
vendored
@@ -88,21 +88,7 @@ async function init() {
|
||||
});
|
||||
|
||||
window.__sync_prompts = async function() {
|
||||
const res = await fetch('https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv');
|
||||
if (res.ok) {
|
||||
const data = await res.text();
|
||||
await invoke('sync_prompts', { data, time: Date.now() });
|
||||
} else {
|
||||
invoke('messageDialog', {
|
||||
__tauriModule: 'Dialog',
|
||||
message: {
|
||||
cmd: 'messageDialog',
|
||||
message: 'ChatGPT Prompts data sync failed, please try again!'.toString(),
|
||||
title: 'Sync Prompts'.toString(),
|
||||
type: 'error'
|
||||
}
|
||||
})
|
||||
}
|
||||
await invoke('sync_prompts', { time: Date.now() });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user