mirror of
https://github.com/silvanocerza/github-gitless-sync.git
synced 2026-07-22 05:41:36 +00:00
Simplify upload dialog to not upload directly
This commit is contained in:
parent
176c52b68a
commit
6bff97ace2
1 changed files with 4 additions and 19 deletions
|
|
@ -121,25 +121,10 @@ const UploadDialogContent = ({ onCancel }: { onCancel: () => void }) => {
|
|||
if (abortController.signal.aborted) {
|
||||
return;
|
||||
}
|
||||
await plugin.client.uploadFile(
|
||||
plugin.settings.githubOwner,
|
||||
plugin.settings.githubRepo,
|
||||
plugin.settings.githubBranch,
|
||||
file.path,
|
||||
);
|
||||
// Reset dirty state
|
||||
plugin.metadataStore.data[file.path].dirty = false;
|
||||
|
||||
// Gets the new SHA of the file
|
||||
const sha = await plugin.client.getFileSha(
|
||||
plugin.settings.githubOwner,
|
||||
plugin.settings.githubRepo,
|
||||
plugin.settings.githubBranch,
|
||||
file.path,
|
||||
);
|
||||
plugin.metadataStore.data[file.path].sha = sha;
|
||||
await plugin.metadataStore.save();
|
||||
|
||||
await plugin.eventsConsumer.process({
|
||||
type: "modify",
|
||||
filePath: file.path,
|
||||
});
|
||||
if (abortController.signal.aborted) {
|
||||
// Check abort state only after the uploaded file metadata
|
||||
// is updated, otherwise we risk having outdated SHAs
|
||||
|
|
|
|||
Loading…
Reference in a new issue