mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 20:32:46 +08:00
feat: use commit time as version id
This commit is contained in:
@@ -53,10 +53,9 @@ export const useUpdateStore = create<UpdateStore>()(
|
||||
}));
|
||||
|
||||
try {
|
||||
// const data = await (await fetch(FETCH_TAG_URL)).json();
|
||||
// const remoteId = data[0].name as string;
|
||||
const data = await (await fetch(FETCH_COMMIT_URL)).json();
|
||||
const remoteId = (data[0].sha as string).substring(0, 7);
|
||||
const remoteCommitTime = data[0].commit.committer.date;
|
||||
const remoteId = new Date(remoteCommitTime).getTime().toString();
|
||||
set(() => ({
|
||||
remoteVersion: remoteId,
|
||||
}));
|
||||
|
Reference in New Issue
Block a user