Skip to content

Commit d69390d

Browse files
committed
fix: Make addFile calls async in AppFilesTab
Convert addFile() calls to await to ensure proper async handling when adding files from the Nextcloud Files app sidebar. This prevents race conditions where selectFile() might be called before the file is fully added to the store. Signed-off-by: Vitor Mattos <[email protected]>
1 parent 939bf15 commit d69390d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Components/RightSidebar/AppFilesTab.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export default {
3434
}
3535
},
3636
methods: {
37-
checkAndLoadPendingEnvelope() {
37+
async checkAndLoadPendingEnvelope() {
3838
const pendingEnvelope = window.OCA?.Libresign?.pendingEnvelope
3939
if (pendingEnvelope?.id) {
40-
this.filesStore.addFile(pendingEnvelope)
40+
await this.filesStore.addFile(pendingEnvelope)
4141
this.filesStore.selectFile(pendingEnvelope.id)
4242
delete window.OCA.Libresign.pendingEnvelope
4343
@@ -87,7 +87,7 @@ export default {
8787
},
8888
8989
async update(fileInfo) {
90-
if (this.checkAndLoadPendingEnvelope()) {
90+
if (await this.checkAndLoadPendingEnvelope()) {
9191
return
9292
}
9393
@@ -97,7 +97,7 @@ export default {
9797
return
9898
}
9999
100-
this.filesStore.addFile({
100+
await this.filesStore.addFile({
101101
nodeId: fileInfo.id,
102102
name: fileInfo.name,
103103
file: generateRemoteUrl(`dav/files/${getCurrentUser()?.uid}/${fileInfo.path + '/' + fileInfo.name}`)

0 commit comments

Comments
 (0)