diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-03-17 20:33:33 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-17 20:33:33 +0900 |
| commit | b65203c9f852a29a3a6e7ce81c6761e9ac228bf3 (patch) | |
| tree | 02895c65f35acde60e1fd52e37c23c58e0fd9946 /packages/frontend/src/boot | |
| parent | feat: send heartbeat right after visibility changed to 'visible' (#13581) (diff) | |
| download | misskey-b65203c9f852a29a3a6e7ce81c6761e9ac228bf3.tar.gz misskey-b65203c9f852a29a3a6e7ce81c6761e9ac228bf3.tar.bz2 misskey-b65203c9f852a29a3a6e7ce81c6761e9ac228bf3.zip | |
fix(frontend): WebGL2コンテキストの初期化に失敗するとMisskeyが起動できなくなる問題を修正 (#13587)
* Fixed startup crash with seasonal effects
(cherry picked from commit eba0c2cc61512db22109e2f15604eb65f5b7d2f2)
* Update Changelog
* Update Changelog
---------
Co-authored-by: Leah <kevinlukej@gmail.com>
Diffstat (limited to 'packages/frontend/src/boot')
| -rw-r--r-- | packages/frontend/src/boot/main-boot.ts | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 8016e8b0e0..5cb19f388a 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -75,27 +75,31 @@ export async function mainBoot() { mainRouter.push('/search'); }, }; - - if (defaultStore.state.enableSeasonalScreenEffect) { - const month = new Date().getMonth() + 1; - if (defaultStore.state.hemisphere === 'S') { - // ▼南半球 - if (month === 7 || month === 8) { - const SnowfallEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect; - new SnowfallEffect({}).render(); - } - } else { - // ▼北半球 - if (month === 12 || month === 1) { - const SnowfallEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect; - new SnowfallEffect({}).render(); - } else if (month === 3 || month === 4) { - const SakuraEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect; - new SakuraEffect({ - sakura: true, - }).render(); + try { + if (defaultStore.state.enableSeasonalScreenEffect) { + const month = new Date().getMonth() + 1; + if (defaultStore.state.hemisphere === 'S') { + // ▼南半球 + if (month === 7 || month === 8) { + const SnowfallEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect; + new SnowfallEffect({}).render(); + } + } else { + // ▼北半球 + if (month === 12 || month === 1) { + const SnowfallEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect; + new SnowfallEffect({}).render(); + } else if (month === 3 || month === 4) { + const SakuraEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect; + new SakuraEffect({ + sakura: true, + }).render(); + } } - } + } + } catch (error) { + // console.error(error); + console.error('Failed to initialise the seasonal screen effect canvas context:', error); } if ($i) { |