Skip to content

Commit 01ce148

Browse files
authored
fix: tolgee loading forever if run fails (#3170)
1 parent d0d75b1 commit 01ce148

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/react/src/TolgeeProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const TolgeeProvider: React.FC<Props> = ({
2626
const [loading, setLoading] = useState(!tolgee.isLoaded());
2727

2828
useEffect(() => {
29-
tolgee.run().then(() => {
29+
tolgee.run().finally(() => {
3030
setLoading(false);
3131
});
3232
return () => {

packages/svelte/src/lib/TolgeeProvider.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
if (typeof window !== 'undefined') {
1616
onMount(() => {
17-
tolgee.run().then(() => {
17+
tolgee.run().finally(() => {
1818
isLoading = false
1919
})
2020
});

packages/vue/src/TolgeeProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const TolgeeProvider = defineComponent({
3333
const isLoading = ref(!tolgee.isLoaded());
3434

3535
onBeforeMount(() => {
36-
tolgee.run().then(() => {
36+
tolgee.run().finally(() => {
3737
isLoading.value = false;
3838
});
3939
});

0 commit comments

Comments
 (0)