From 0afd1de14ea3c5cfd229988a42816a13e0dca62c Mon Sep 17 00:00:00 2001 From: sup39 Date: Sun, 11 Feb 2024 20:36:33 +0900 Subject: [PATCH] fix: push notification Co-authored-by: naskya --- packages/client/src/config.ts | 2 +- packages/client/src/init.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/client/src/config.ts b/packages/client/src/config.ts index fb71e422..0a523f87 100644 --- a/packages/client/src/config.ts +++ b/packages/client/src/config.ts @@ -10,7 +10,7 @@ export const apiUrl = `${url}/api`; export const wsUrl = `${url .replace("http://", "ws://") .replace("https://", "wss://")}/streaming`; -export const lang = localStorage.getItem("lang")?.split("-")[0] ?? "en"; +export const lang = localStorage.getItem("lang") ?? "en-US"; export const langs = _LANGS_; export const locale = JSON.parse(localStorage.getItem("locale") || "en-US"); export const version = _VERSION_; diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index b944fb42..061185a7 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -124,7 +124,10 @@ function checkForSplash() { // #region Set lang attr const html = document.documentElement; html.setAttribute("lang", lang ?? "en-US"); - html.setAttribute("dir", langmap[lang].rtl === true ? "rtl" : "ltr"); + html.setAttribute( + "dir", + langmap[lang.split("-", 1)[0]].rtl === true ? "rtl" : "ltr", + ); // #endregion // #region loginId