Skip to content

Commit 014d8f9

Browse files
core: frontend: components: speedtest: NetworkSpeedTest: Fix upload final test
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
1 parent 9133aee commit 014d8f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/frontend/src/components/speedtest/NetworkSpeedTest.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,18 @@ export default Vue.extend({
219219
`network-test: Upload: ${speed_Mb.toFixed(2)}Mbps ${percentage.toFixed(2)}% ${seconds.toFixed(2)}s`,
220220
)
221221
this.setSpeed(speed_Mb)
222+
223+
// For some reason, this code never reaches finally block
224+
// So we need to check if the upload is done
225+
if (percentage > 99) {
226+
this.updateState(State.Done)
227+
}
222228
},
223229
}).catch((error) => {
224230
const message = `Failed to do speed test: ${error.message}`
225231
notifier.pushError('NETWORK_SPEED_TEST_UPLOAD', message)
226232
console.error(message)
227-
}).finally(() => this.updateState(State.Done))
233+
})
228234
},
229235
checkDownloadSpeed(): void {
230236
const one_hundred_mega_bytes = 100 * 2 ** 20

0 commit comments

Comments
 (0)