Explorar o código

[web] Miscellaneous code improvements (#1336)

Manav Rathi hai 1 ano
pai
achega
8764e5cf4d
Modificáronse 100 ficheiros con 128 adicións e 180 borrados
  1. 0 1
      web/apps/accounts/public/locales/bg-BG/translation.json
  2. 0 1
      web/apps/accounts/public/locales/de-DE/translation.json
  3. 0 1
      web/apps/accounts/public/locales/en-US/translation.json
  4. 0 1
      web/apps/accounts/public/locales/es-ES/translation.json
  5. 0 1
      web/apps/accounts/public/locales/fa-IR/translation.json
  6. 0 1
      web/apps/accounts/public/locales/fi-FI/translation.json
  7. 0 1
      web/apps/accounts/public/locales/fr-FR/translation.json
  8. 0 1
      web/apps/accounts/public/locales/it-IT/translation.json
  9. 0 1
      web/apps/accounts/public/locales/ko-KR/translation.json
  10. 0 1
      web/apps/accounts/public/locales/nl-NL/translation.json
  11. 0 1
      web/apps/accounts/public/locales/pt-BR/translation.json
  12. 0 1
      web/apps/accounts/public/locales/pt-PT/translation.json
  13. 0 1
      web/apps/accounts/public/locales/ru-RU/translation.json
  14. 0 1
      web/apps/accounts/public/locales/sv-SE/translation.json
  15. 0 1
      web/apps/accounts/public/locales/th-TH/translation.json
  16. 0 1
      web/apps/accounts/public/locales/tr-TR/translation.json
  17. 0 1
      web/apps/accounts/public/locales/zh-CN/translation.json
  18. 1 3
      web/apps/accounts/src/pages/_app.tsx
  19. 1 2
      web/apps/accounts/src/pages/passkeys/flow/index.tsx
  20. 0 1
      web/apps/auth/public/locales/bg-BG/translation.json
  21. 0 1
      web/apps/auth/public/locales/de-DE/translation.json
  22. 0 1
      web/apps/auth/public/locales/en-US/translation.json
  23. 0 1
      web/apps/auth/public/locales/es-ES/translation.json
  24. 0 1
      web/apps/auth/public/locales/fa-IR/translation.json
  25. 0 1
      web/apps/auth/public/locales/fi-FI/translation.json
  26. 0 1
      web/apps/auth/public/locales/fr-FR/translation.json
  27. 0 1
      web/apps/auth/public/locales/it-IT/translation.json
  28. 0 1
      web/apps/auth/public/locales/ko-KR/translation.json
  29. 0 1
      web/apps/auth/public/locales/nl-NL/translation.json
  30. 0 1
      web/apps/auth/public/locales/pt-BR/translation.json
  31. 0 1
      web/apps/auth/public/locales/pt-PT/translation.json
  32. 0 1
      web/apps/auth/public/locales/ru-RU/translation.json
  33. 0 1
      web/apps/auth/public/locales/sv-SE/translation.json
  34. 0 1
      web/apps/auth/public/locales/th-TH/translation.json
  35. 0 1
      web/apps/auth/public/locales/tr-TR/translation.json
  36. 0 1
      web/apps/auth/public/locales/zh-CN/translation.json
  37. 1 2
      web/apps/auth/src/pages/_app.tsx
  38. 0 1
      web/apps/cast/public/locales/bg-BG/translation.json
  39. 0 1
      web/apps/cast/public/locales/de-DE/translation.json
  40. 0 1
      web/apps/cast/public/locales/en-US/translation.json
  41. 0 1
      web/apps/cast/public/locales/es-ES/translation.json
  42. 0 1
      web/apps/cast/public/locales/fa-IR/translation.json
  43. 0 1
      web/apps/cast/public/locales/fi-FI/translation.json
  44. 0 1
      web/apps/cast/public/locales/fr-FR/translation.json
  45. 0 1
      web/apps/cast/public/locales/it-IT/translation.json
  46. 0 1
      web/apps/cast/public/locales/ko-KR/translation.json
  47. 0 1
      web/apps/cast/public/locales/nl-NL/translation.json
  48. 0 1
      web/apps/cast/public/locales/pt-BR/translation.json
  49. 0 1
      web/apps/cast/public/locales/pt-PT/translation.json
  50. 0 1
      web/apps/cast/public/locales/ru-RU/translation.json
  51. 0 1
      web/apps/cast/public/locales/sv-SE/translation.json
  52. 0 1
      web/apps/cast/public/locales/th-TH/translation.json
  53. 0 1
      web/apps/cast/public/locales/tr-TR/translation.json
  54. 0 1
      web/apps/cast/public/locales/zh-CN/translation.json
  55. 1 1
      web/apps/cast/src/pages/index.tsx
  56. 1 1
      web/apps/cast/src/services/wasm/ffmpeg.ts
  57. 0 0
      web/apps/cast/src/utils/useCastReceiver.tsx
  58. 0 1
      web/apps/photos/public/locales/bg-BG/translation.json
  59. 0 1
      web/apps/photos/public/locales/de-DE/translation.json
  60. 0 1
      web/apps/photos/public/locales/en-US/translation.json
  61. 0 1
      web/apps/photos/public/locales/es-ES/translation.json
  62. 0 1
      web/apps/photos/public/locales/fa-IR/translation.json
  63. 0 1
      web/apps/photos/public/locales/fi-FI/translation.json
  64. 0 1
      web/apps/photos/public/locales/fr-FR/translation.json
  65. 0 1
      web/apps/photos/public/locales/it-IT/translation.json
  66. 0 1
      web/apps/photos/public/locales/ko-KR/translation.json
  67. 0 1
      web/apps/photos/public/locales/nl-NL/translation.json
  68. 0 1
      web/apps/photos/public/locales/pt-BR/translation.json
  69. 0 1
      web/apps/photos/public/locales/pt-PT/translation.json
  70. 0 1
      web/apps/photos/public/locales/ru-RU/translation.json
  71. 0 1
      web/apps/photos/public/locales/sv-SE/translation.json
  72. 0 1
      web/apps/photos/public/locales/th-TH/translation.json
  73. 0 1
      web/apps/photos/public/locales/tr-TR/translation.json
  74. 0 1
      web/apps/photos/public/locales/zh-CN/translation.json
  75. 1 1
      web/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx
  76. 2 3
      web/apps/photos/src/components/PhotoList/index.tsx
  77. 30 1
      web/apps/photos/src/components/pages/sharedAlbum/Navbar.tsx
  78. 1 2
      web/apps/photos/src/pages/_app.tsx
  79. 32 1
      web/apps/photos/src/pages/gallery/index.tsx
  80. 1 1
      web/apps/photos/src/services/download/clients/photos.ts
  81. 1 1
      web/apps/photos/src/services/download/clients/publicAlbums.ts
  82. 1 1
      web/apps/photos/src/services/export/index.ts
  83. 1 1
      web/apps/photos/src/services/export/migration.ts
  84. 1 1
      web/apps/photos/src/services/heic-convert/service.ts
  85. 2 2
      web/apps/photos/src/services/upload/thumbnailService.ts
  86. 1 1
      web/apps/photos/src/services/upload/uploader.ts
  87. 1 1
      web/apps/photos/src/services/wasm/ffmpeg.ts
  88. 1 35
      web/apps/photos/src/utils/common/index.ts
  89. 0 22
      web/apps/photos/src/utils/common/promiseTimeout.ts
  90. 1 2
      web/apps/photos/src/utils/file/index.ts
  91. 1 1
      web/apps/photos/src/utils/upload/uploadRetrier.ts
  92. 0 0
      web/apps/photos/src/utils/useCastSender.tsx
  93. 4 1
      web/packages/accounts/components/ChangeEmail.tsx
  94. 7 5
      web/packages/accounts/pages/change-email.tsx
  95. 4 1
      web/packages/accounts/pages/change-password.tsx
  96. 12 15
      web/packages/accounts/pages/credentials.tsx
  97. 5 1
      web/packages/accounts/pages/generate.tsx
  98. 4 1
      web/packages/accounts/pages/login.tsx
  99. 5 1
      web/packages/accounts/pages/recover.tsx
  100. 4 1
      web/packages/accounts/pages/signup.tsx

+ 0 - 1
web/apps/accounts/public/locales/bg-BG/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/de-DE/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Enthält schädliche Inhalte",
     "COPYRIGHT": "Verletzung des Urheberrechts von jemandem, den ich repräsentieren darf",
     "SHARED_USING": "Freigegeben über ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Passwort-Sperre deaktivieren",

+ 0 - 1
web/apps/accounts/public/locales/en-US/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contains malicious content",
     "COPYRIGHT": "Infringes on the copyright of someone I am authorized to represent",
     "SHARED_USING": "Shared using ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Use code <strong>{{referralCode}}</strong> to get 10 GB free",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Disable password lock",

+ 0 - 1
web/apps/accounts/public/locales/es-ES/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contiene contenido malicioso",
     "COPYRIGHT": "Infracciones sobre los derechos de autor de alguien que estoy autorizado a representar",
     "SHARED_USING": "Compartido usando ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Usa el código <strong>{{referralCode}}</strong> para obtener 10 GB gratis",
     "LIVE": "VIVO",
     "DISABLE_PASSWORD": "Desactivar contraseña",

+ 0 - 1
web/apps/accounts/public/locales/fa-IR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/fi-FI/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/fr-FR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contient du contenu malveillant",
     "COPYRIGHT": "Enfreint les droits d'une personne que je réprésente",
     "SHARED_USING": "Partagé en utilisant ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Utilisez le code <strong>{{referralCode}}</strong> pour obtenir 10 Go gratuits",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Désactiver le verrouillage par mot de passe",

+ 0 - 1
web/apps/accounts/public/locales/it-IT/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/ko-KR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/nl-NL/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Bevat kwaadwillende inhoud",
     "COPYRIGHT": "Schending van het auteursrecht van iemand die ik mag vertegenwoordigen",
     "SHARED_USING": "Gedeeld via ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Gebruik code <strong>{{referralCode}}</strong> om 10 GB gratis te krijgen",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Schakel cijfercode vergrendeling uit",

+ 0 - 1
web/apps/accounts/public/locales/pt-BR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contém conteúdo malicioso",
     "COPYRIGHT": "Viola os direitos autorais de alguém que estou autorizado a representar",
     "SHARED_USING": "Compartilhar usando ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Use o código <strong>{{referralCode}}</strong> para obter 10 GB de graça",
     "LIVE": "AO VIVO",
     "DISABLE_PASSWORD": "Desativar bloqueio por senha",

+ 0 - 1
web/apps/accounts/public/locales/pt-PT/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/ru-RU/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/sv-SE/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/th-TH/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/tr-TR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/accounts/public/locales/zh-CN/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "哈哈哈急急急",
     "COPYRIGHT": "不不不急急急就是",
     "SHARED_USING": "分享方式 ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "使用代码 <strong>{{referralCode}}</strong> 获得 10 GB 免费空间",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "禁用密码锁",

+ 1 - 3
web/apps/accounts/src/pages/_app.tsx

@@ -30,7 +30,7 @@ interface AppContextProps {
 
 export const AppContext = createContext<AppContextProps>({} as AppContextProps);
 
-export default function App(props: AppProps) {
+export default function App({ Component, pageProps }: AppProps) {
     const [isI18nReady, setIsI18nReady] = useState<boolean>(false);
 
     const [showNavbar, setShowNavBar] = useState(false);
@@ -50,8 +50,6 @@ export default function App(props: AppProps) {
 
     const router = useRouter();
 
-    const { Component, pageProps } = props;
-
     const [themeColor] = useLocalState(LS_KEYS.THEME, THEME_COLOR.DARK);
 
     useEffect(() => {

+ 1 - 2
web/apps/accounts/src/pages/passkeys/flow/index.tsx

@@ -13,7 +13,6 @@ import InfoIcon from "@mui/icons-material/Info";
 import { Box, Typography } from "@mui/material";
 import { t } from "i18next";
 import _sodium from "libsodium-wrappers";
-import Image from "next/image";
 import { useEffect, useState } from "react";
 import {
     BeginPasskeyAuthenticationResponse,
@@ -297,7 +296,7 @@ const PasskeysFlow = () => {
                             {t("PASSKEY_FOLLOW_THE_STEPS_FROM_YOUR_BROWSER")}
                         </Typography>
                         <CenteredFlex marginTop="1rem">
-                            <Image
+                            <img
                                 alt="ente Logo Circular"
                                 height={150}
                                 width={150}

+ 0 - 1
web/apps/auth/public/locales/bg-BG/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/de-DE/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Enthält schädliche Inhalte",
     "COPYRIGHT": "Verletzung des Urheberrechts von jemandem, den ich repräsentieren darf",
     "SHARED_USING": "Freigegeben über ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Passwort-Sperre deaktivieren",

+ 0 - 1
web/apps/auth/public/locales/en-US/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contains malicious content",
     "COPYRIGHT": "Infringes on the copyright of someone I am authorized to represent",
     "SHARED_USING": "Shared using ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Use code <strong>{{referralCode}}</strong> to get 10 GB free",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Disable password lock",

+ 0 - 1
web/apps/auth/public/locales/es-ES/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contiene contenido malicioso",
     "COPYRIGHT": "Infracciones sobre los derechos de autor de alguien que estoy autorizado a representar",
     "SHARED_USING": "Compartido usando ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Usa el código <strong>{{referralCode}}</strong> para obtener 10 GB gratis",
     "LIVE": "VIVO",
     "DISABLE_PASSWORD": "Desactivar contraseña",

+ 0 - 1
web/apps/auth/public/locales/fa-IR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/fi-FI/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/fr-FR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contient du contenu malveillant",
     "COPYRIGHT": "Enfreint les droits d'une personne que je réprésente",
     "SHARED_USING": "Partagé en utilisant ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Utilisez le code <strong>{{referralCode}}</strong> pour obtenir 10 Go gratuits",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Désactiver le verrouillage par mot de passe",

+ 0 - 1
web/apps/auth/public/locales/it-IT/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/ko-KR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/nl-NL/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Bevat kwaadwillende inhoud",
     "COPYRIGHT": "Schending van het auteursrecht van iemand die ik mag vertegenwoordigen",
     "SHARED_USING": "Gedeeld via ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Gebruik code <strong>{{referralCode}}</strong> om 10 GB gratis te krijgen",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Schakel cijfercode vergrendeling uit",

+ 0 - 1
web/apps/auth/public/locales/pt-BR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contém conteúdo malicioso",
     "COPYRIGHT": "Viola os direitos autorais de alguém que estou autorizado a representar",
     "SHARED_USING": "Compartilhar usando ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Use o código <strong>{{referralCode}}</strong> para obter 10 GB de graça",
     "LIVE": "AO VIVO",
     "DISABLE_PASSWORD": "Desativar bloqueio por senha",

+ 0 - 1
web/apps/auth/public/locales/pt-PT/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/ru-RU/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/sv-SE/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/th-TH/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/tr-TR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/auth/public/locales/zh-CN/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "哈哈哈急急急",
     "COPYRIGHT": "不不不急急急就是",
     "SHARED_USING": "分享方式 ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "使用代码 <strong>{{referralCode}}</strong> 获得 10 GB 免费空间",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "禁用密码锁",

+ 1 - 2
web/apps/auth/src/pages/_app.tsx

@@ -47,8 +47,7 @@ type AppContextType = {
 
 export const AppContext = createContext<AppContextType>(null);
 
-export default function App(props: AppProps) {
-    const { Component, pageProps } = props;
+export default function App({ Component, pageProps }: AppProps) {
     const router = useRouter();
     const [isI18nReady, setIsI18nReady] = useState<boolean>(false);
     const [loading, setLoading] = useState(false);

+ 0 - 1
web/apps/cast/public/locales/bg-BG/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/de-DE/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Enthält schädliche Inhalte",
     "COPYRIGHT": "Verletzung des Urheberrechts von jemandem, den ich repräsentieren darf",
     "SHARED_USING": "Freigegeben über ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Passwort-Sperre deaktivieren",

+ 0 - 1
web/apps/cast/public/locales/en-US/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contains malicious content",
     "COPYRIGHT": "Infringes on the copyright of someone I am authorized to represent",
     "SHARED_USING": "Shared using ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Use code <strong>{{referralCode}}</strong> to get 10 GB free",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Disable password lock",

+ 0 - 1
web/apps/cast/public/locales/es-ES/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contiene contenido malicioso",
     "COPYRIGHT": "Infracciones sobre los derechos de autor de alguien que estoy autorizado a representar",
     "SHARED_USING": "Compartido usando ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Usa el código <strong>{{referralCode}}</strong> para obtener 10 GB gratis",
     "LIVE": "VIVO",
     "DISABLE_PASSWORD": "Desactivar contraseña",

+ 0 - 1
web/apps/cast/public/locales/fa-IR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/fi-FI/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/fr-FR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contient du contenu malveillant",
     "COPYRIGHT": "Enfreint les droits d'une personne que je réprésente",
     "SHARED_USING": "Partagé en utilisant ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Utilisez le code <strong>{{referralCode}}</strong> pour obtenir 10 Go gratuits",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Désactiver le verrouillage par mot de passe",

+ 0 - 1
web/apps/cast/public/locales/it-IT/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/ko-KR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/nl-NL/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Bevat kwaadwillende inhoud",
     "COPYRIGHT": "Schending van het auteursrecht van iemand die ik mag vertegenwoordigen",
     "SHARED_USING": "Gedeeld via ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Gebruik code <strong>{{referralCode}}</strong> om 10 GB gratis te krijgen",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Schakel cijfercode vergrendeling uit",

+ 0 - 1
web/apps/cast/public/locales/pt-BR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contém conteúdo malicioso",
     "COPYRIGHT": "Viola os direitos autorais de alguém que estou autorizado a representar",
     "SHARED_USING": "Compartilhar usando ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Use o código <strong>{{referralCode}}</strong> para obter 10 GB de graça",
     "LIVE": "AO VIVO",
     "DISABLE_PASSWORD": "Desativar bloqueio por senha",

+ 0 - 1
web/apps/cast/public/locales/pt-PT/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/ru-RU/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/sv-SE/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/th-TH/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/tr-TR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/cast/public/locales/zh-CN/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "哈哈哈急急急",
     "COPYRIGHT": "不不不急急急就是",
     "SHARED_USING": "分享方式 ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "使用代码 <strong>{{referralCode}}</strong> 获得 10 GB 免费空间",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "禁用密码锁",

+ 1 - 1
web/apps/cast/src/pages/index.tsx

@@ -1,6 +1,5 @@
 import EnteSpinner from "@ente/shared/components/EnteSpinner";
 import { boxSealOpen, toB64 } from "@ente/shared/crypto/internal/libsodium";
-import { useCastReceiver } from "@ente/shared/hooks/useCastReceiver";
 import { addLogLine } from "@ente/shared/logging";
 import castGateway from "@ente/shared/network/cast";
 import LargeType from "components/LargeType";
@@ -8,6 +7,7 @@ import _sodium from "libsodium-wrappers";
 import { useRouter } from "next/router";
 import { useEffect, useState } from "react";
 import { storeCastData } from "services/cast/castService";
+import { useCastReceiver } from "../utils/useCastReceiver";
 
 // Function to generate cryptographically secure digits
 const generateSecureData = (length: number): Uint8Array => {

+ 1 - 1
web/apps/cast/src/services/wasm/ffmpeg.ts

@@ -1,6 +1,6 @@
 import { addLogLine } from "@ente/shared/logging";
-import { promiseWithTimeout } from "@ente/shared/promise";
 import { logError } from "@ente/shared/sentry";
+import { promiseWithTimeout } from "@ente/shared/utils";
 import QueueProcessor from "@ente/shared/utils/queueProcessor";
 import { generateTempName } from "@ente/shared/utils/temp";
 import { createFFmpeg, FFmpeg } from "ffmpeg-wasm";

+ 0 - 0
web/packages/shared/hooks/useCastReceiver.tsx → web/apps/cast/src/utils/useCastReceiver.tsx


+ 0 - 1
web/apps/photos/public/locales/bg-BG/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/photos/public/locales/de-DE/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Enthält schädliche Inhalte",
     "COPYRIGHT": "Verletzung des Urheberrechts von jemandem, den ich repräsentieren darf",
     "SHARED_USING": "Freigegeben über ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Passwort-Sperre deaktivieren",

+ 0 - 1
web/apps/photos/public/locales/en-US/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contains malicious content",
     "COPYRIGHT": "Infringes on the copyright of someone I am authorized to represent",
     "SHARED_USING": "Shared using ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Use code <strong>{{referralCode}}</strong> to get 10 GB free",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Disable password lock",

+ 0 - 1
web/apps/photos/public/locales/es-ES/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contiene contenido malicioso",
     "COPYRIGHT": "Infracciones sobre los derechos de autor de alguien que estoy autorizado a representar",
     "SHARED_USING": "Compartido usando ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Usa el código <strong>{{referralCode}}</strong> para obtener 10 GB gratis",
     "LIVE": "VIVO",
     "DISABLE_PASSWORD": "Desactivar contraseña",

+ 0 - 1
web/apps/photos/public/locales/fa-IR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/photos/public/locales/fi-FI/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/photos/public/locales/fr-FR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contient du contenu malveillant",
     "COPYRIGHT": "Enfreint les droits d'une personne que je réprésente",
     "SHARED_USING": "Partagé en utilisant ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Utilisez le code <strong>{{referralCode}}</strong> pour obtenir 10 Go gratuits",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Désactiver le verrouillage par mot de passe",

+ 0 - 1
web/apps/photos/public/locales/it-IT/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/photos/public/locales/ko-KR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/photos/public/locales/nl-NL/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Bevat kwaadwillende inhoud",
     "COPYRIGHT": "Schending van het auteursrecht van iemand die ik mag vertegenwoordigen",
     "SHARED_USING": "Gedeeld via ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Gebruik code <strong>{{referralCode}}</strong> om 10 GB gratis te krijgen",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "Schakel cijfercode vergrendeling uit",

+ 0 - 1
web/apps/photos/public/locales/pt-BR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Contém conteúdo malicioso",
     "COPYRIGHT": "Viola os direitos autorais de alguém que estou autorizado a representar",
     "SHARED_USING": "Compartilhar usando ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Use o código <strong>{{referralCode}}</strong> para obter 10 GB de graça",
     "LIVE": "AO VIVO",
     "DISABLE_PASSWORD": "Desativar bloqueio por senha",

+ 0 - 1
web/apps/photos/public/locales/pt-PT/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/photos/public/locales/ru-RU/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "Содержит вредоносный контент",
     "COPYRIGHT": "Нарушает авторские права человека, которого я уполномочен представлять",
     "SHARED_USING": "Совместное использование ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "Используйте код <strong>{{referralCode}}</strong> чтобы получить 10 ГБ бесплатно",
     "LIVE": "Жить",
     "DISABLE_PASSWORD": "Отключить блокировку паролем",

+ 0 - 1
web/apps/photos/public/locales/sv-SE/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/photos/public/locales/th-TH/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/photos/public/locales/tr-TR/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "",
     "COPYRIGHT": "",
     "SHARED_USING": "",
-    "ENTE_IO": "",
     "SHARING_REFERRAL_CODE": "",
     "LIVE": "",
     "DISABLE_PASSWORD": "",

+ 0 - 1
web/apps/photos/public/locales/zh-CN/translation.json

@@ -406,7 +406,6 @@
     "MALICIOUS_CONTENT": "哈哈哈急急急",
     "COPYRIGHT": "不不不急急急就是",
     "SHARED_USING": "分享方式 ",
-    "ENTE_IO": "ente.io",
     "SHARING_REFERRAL_CODE": "使用代码 <strong>{{referralCode}}</strong> 获得 10 GB 免费空间",
     "LIVE": "LIVE",
     "DISABLE_PASSWORD": "禁用密码锁",

+ 1 - 1
web/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx

@@ -6,7 +6,6 @@ import SingleInputForm, {
     SingleInputFormProps,
 } from "@ente/shared/components/SingleInputForm";
 import { boxSeal } from "@ente/shared/crypto/internal/libsodium";
-import { loadSender } from "@ente/shared/hooks/useCastSender";
 import { addLogLine } from "@ente/shared/logging";
 import castGateway from "@ente/shared/network/cast";
 import { logError } from "@ente/shared/sentry";
@@ -16,6 +15,7 @@ import { useEffect, useState } from "react";
 import { Trans } from "react-i18next";
 import { Collection } from "types/collection";
 import { v4 as uuidv4 } from "uuid";
+import { loadSender } from "../../../utils/useCastSender";
 
 interface Props {
     show: boolean;

+ 2 - 3
web/apps/photos/src/components/PhotoList/index.tsx

@@ -1,5 +1,4 @@
 import { FlexWrapper } from "@ente/shared/components/Container";
-import { ENTE_WEBSITE_LINK } from "@ente/shared/constants/urls";
 import { formatDate, getDate, isSameDay } from "@ente/shared/time/format";
 import { convertBytesToHumanReadable } from "@ente/shared/utils/size";
 import { Box, Checkbox, Link, Typography, styled } from "@mui/material";
@@ -583,8 +582,8 @@ export function PhotoList({
                     <Box width={"100%"}>
                         <Typography variant="small" display={"block"}>
                             {t("SHARED_USING")}{" "}
-                            <Link target="_blank" href={ENTE_WEBSITE_LINK}>
-                                {t("ENTE_IO")}
+                            <Link target="_blank" href={"https://ente.io"}>
+                                ente.io
                             </Link>
                         </Typography>
                         {publicCollectionGalleryContext.referralCode ? (

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 30 - 1
web/apps/photos/src/components/pages/sharedAlbum/Navbar.tsx


+ 1 - 2
web/apps/photos/src/pages/_app.tsx

@@ -111,8 +111,7 @@ type AppContextType = {
 
 export const AppContext = createContext<AppContextType>(null);
 
-export default function App(props: AppProps) {
-    const { Component, pageProps } = props;
+export default function App({ Component, pageProps }: AppProps) {
     const router = useRouter();
     const [isI18nReady, setIsI18nReady] = useState<boolean>(false);
     const [loading, setLoading] = useState(false);

+ 32 - 1
web/apps/photos/src/pages/gallery/index.tsx

@@ -92,13 +92,13 @@ import {
 import { APPS } from "@ente/shared/apps/constants";
 import { CenteredFlex } from "@ente/shared/components/Container";
 import ElectronAPIs from "@ente/shared/electron";
-import useEffectSingleThreaded from "@ente/shared/hooks/useEffectSingleThreaded";
 import useFileInput from "@ente/shared/hooks/useFileInput";
 import useMemoSingleThreaded from "@ente/shared/hooks/useMemoSingleThreaded";
 import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
 import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
 import { getToken } from "@ente/shared/storage/localStorage/helpers";
 import { User } from "@ente/shared/user/types";
+import { isPromise } from "@ente/shared/utils";
 import AuthenticateUserModal from "components/AuthenticateUserModal";
 import Collections from "components/Collections";
 import ExportModal from "components/ExportModal";
@@ -1221,3 +1221,34 @@ export default function Gallery() {
         </GalleryContext.Provider>
     );
 }
+
+// useEffectSingleThreaded is a useEffect that will only run one at a time, and will
+// caches the latest deps of requests that come in while it is running, and will
+// run that after the current run is complete.
+function useEffectSingleThreaded(
+    fn: (deps) => void | Promise<void>,
+    deps: any[],
+): void {
+    const updateInProgress = useRef(false);
+    const nextRequestDepsRef = useRef<any[]>(null);
+    useEffect(() => {
+        const main = async (deps) => {
+            if (updateInProgress.current) {
+                nextRequestDepsRef.current = deps;
+                return;
+            }
+            updateInProgress.current = true;
+            const result = fn(deps);
+            if (isPromise(result)) {
+                await result;
+            }
+            updateInProgress.current = false;
+            if (nextRequestDepsRef.current) {
+                const deps = nextRequestDepsRef.current;
+                nextRequestDepsRef.current = null;
+                setTimeout(() => main(deps), 0);
+            }
+        };
+        main(deps);
+    }, deps);
+}

+ 1 - 1
web/apps/photos/src/services/download/clients/photos.ts

@@ -1,7 +1,7 @@
 import { CustomError } from "@ente/shared/error";
 import HTTPService from "@ente/shared/network/HTTPService";
 import { getFileURL, getThumbnailURL } from "@ente/shared/network/api";
-import { retryAsyncFunction } from "@ente/shared/promise";
+import { retryAsyncFunction } from "@ente/shared/utils";
 import { DownloadClient } from "services/download";
 import { EnteFile } from "types/file";
 

+ 1 - 1
web/apps/photos/src/services/download/clients/publicAlbums.ts

@@ -4,7 +4,7 @@ import {
     getPublicCollectionFileURL,
     getPublicCollectionThumbnailURL,
 } from "@ente/shared/network/api";
-import { retryAsyncFunction } from "@ente/shared/promise";
+import { retryAsyncFunction } from "@ente/shared/utils";
 import { DownloadClient } from "services/download";
 import { EnteFile } from "types/file";
 

+ 1 - 1
web/apps/photos/src/services/export/index.ts

@@ -1,7 +1,7 @@
 import { logError } from "@ente/shared/sentry";
 import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
+import { sleep } from "@ente/shared/utils";
 import { EnteFile } from "types/file";
-import { sleep } from "utils/common";
 import {
     convertCollectionIDExportNameObjectToMap,
     convertFileIDExportNameObjectToMap,

+ 1 - 1
web/apps/photos/src/services/export/migration.ts

@@ -2,6 +2,7 @@ import { addLocalLog, addLogLine } from "@ente/shared/logging";
 import { logError } from "@ente/shared/sentry";
 import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
 import { User } from "@ente/shared/user/types";
+import { sleep } from "@ente/shared/utils";
 import { FILE_TYPE } from "constants/file";
 import { getLocalCollections } from "services/collectionService";
 import downloadManager from "services/download";
@@ -19,7 +20,6 @@ import {
 } from "types/export";
 import { EnteFile } from "types/file";
 import { getNonEmptyPersonalCollections } from "utils/collection";
-import { sleep } from "utils/common";
 import {
     getCollectionExportPath,
     getCollectionIDFromFileUID,

+ 1 - 1
web/apps/photos/src/services/heic-convert/service.ts

@@ -1,7 +1,7 @@
 import { CustomError } from "@ente/shared/error";
 import { addLogLine } from "@ente/shared/logging";
-import { retryAsyncFunction } from "@ente/shared/promise";
 import { logError } from "@ente/shared/sentry";
+import { retryAsyncFunction } from "@ente/shared/utils";
 import QueueProcessor from "@ente/shared/utils/queueProcessor";
 import { convertBytesToHumanReadable } from "@ente/shared/utils/size";
 import { ComlinkWorker } from "@ente/shared/worker/comlinkWorker";

+ 2 - 2
web/apps/photos/src/services/upload/thumbnailService.ts

@@ -152,7 +152,7 @@ export async function generateImageThumbnailUsingCanvas(
             }
         };
         timeout = setTimeout(
-            () => reject(Error(CustomError.WAIT_TIME_EXCEEDED)),
+            () => reject(new Error("Operation timed out")),
             WAIT_TIME_THUMBNAIL_GENERATION,
         );
     });
@@ -238,7 +238,7 @@ export async function generateVideoThumbnailUsingCanvas(
             }
         });
         timeout = setTimeout(
-            () => reject(Error(CustomError.WAIT_TIME_EXCEEDED)),
+            () => reject(new Error("Operation timed out")),
             WAIT_TIME_THUMBNAIL_GENERATION,
         );
     });

+ 1 - 1
web/apps/photos/src/services/upload/uploader.ts

@@ -2,6 +2,7 @@ import { DedicatedCryptoWorker } from "@ente/shared/crypto/internal/crypto.worke
 import { CustomError, handleUploadError } from "@ente/shared/error";
 import { addLocalLog, addLogLine } from "@ente/shared/logging";
 import { logError } from "@ente/shared/sentry";
+import { sleep } from "@ente/shared/utils";
 import { convertBytesToHumanReadable } from "@ente/shared/utils/size";
 import { Remote } from "comlink";
 import { MAX_FILE_SIZE_SUPPORTED, UPLOAD_RESULT } from "constants/upload";
@@ -15,7 +16,6 @@ import {
     Logger,
     UploadFile,
 } from "types/upload";
-import { sleep } from "utils/common";
 import { findMatchingExistingFiles } from "utils/upload";
 import UIService from "./uiService";
 import uploadCancelService from "./uploadCancelService";

+ 1 - 1
web/apps/photos/src/services/wasm/ffmpeg.ts

@@ -1,10 +1,10 @@
 import { addLogLine } from "@ente/shared/logging";
 import { logError } from "@ente/shared/sentry";
+import { promiseWithTimeout } from "@ente/shared/utils";
 import QueueProcessor from "@ente/shared/utils/queueProcessor";
 import { generateTempName } from "@ente/shared/utils/temp";
 import { createFFmpeg, FFmpeg } from "ffmpeg-wasm";
 import { getUint8ArrayView } from "services/readerService";
-import { promiseWithTimeout } from "utils/common";
 
 const INPUT_PATH_PLACEHOLDER = "INPUT";
 const FFMPEG_PLACEHOLDER = "FFMPEG";

+ 1 - 35
web/apps/photos/src/utils/common/index.ts

@@ -1,5 +1,6 @@
 import { APP_DOWNLOAD_URL } from "@ente/shared/constants/urls";
 import { CustomError } from "@ente/shared/error";
+import { isPromise } from "@ente/shared/utils";
 import isElectron from "is-electron";
 
 export function checkConnectivity() {
@@ -49,12 +50,6 @@ export function webglSupported() {
     }
 }
 
-export async function sleep(time: number) {
-    await new Promise((resolve) => {
-        setTimeout(() => resolve(null), time);
-    });
-}
-
 export function downloadApp() {
     openLink(APP_DOWNLOAD_URL, true);
 }
@@ -71,27 +66,6 @@ export function initiateEmail(email: string) {
     a.rel = "noreferrer noopener";
     a.click();
 }
-export const promiseWithTimeout = async <T>(
-    request: Promise<T>,
-    timeout: number,
-): Promise<T> => {
-    const timeoutRef = { current: null };
-    const rejectOnTimeout = new Promise<null>((_, reject) => {
-        timeoutRef.current = setTimeout(
-            () => reject(Error(CustomError.WAIT_TIME_EXCEEDED)),
-            timeout,
-        );
-    });
-    const requestWithTimeOutCancellation = async () => {
-        const resp = await request;
-        clearTimeout(timeoutRef.current);
-        return resp;
-    };
-    return await Promise.race([
-        requestWithTimeOutCancellation(),
-        rejectOnTimeout,
-    ]);
-};
 
 export const preloadImage = (imgBasePath: string) => {
     const srcSet = [];
@@ -120,14 +94,6 @@ export async function waitAndRun(
     await task();
 }
 
-function isPromise(p: any) {
-    if (typeof p === "object" && typeof p.then === "function") {
-        return true;
-    }
-
-    return false;
-}
-
 export function isClipboardItemPresent() {
     return typeof ClipboardItem !== "undefined";
 }

+ 0 - 22
web/apps/photos/src/utils/common/promiseTimeout.ts

@@ -1,22 +0,0 @@
-import { CustomError } from "@ente/shared/error";
-
-export const promiseWithTimeout = async (
-    request: Promise<any>,
-    timeout: number,
-) => {
-    const timeoutRef = { current: null };
-    const rejectOnTimeout = new Promise((_, reject) => {
-        timeoutRef.current = setTimeout(
-            () => reject(Error(CustomError.WAIT_TIME_EXCEEDED)),
-            timeout,
-        );
-    });
-    return await Promise.race([
-        (async () => {
-            const resp = await request;
-            clearTimeout(timeoutRef.current);
-            return resp;
-        })(),
-        rejectOnTimeout,
-    ]);
-};

+ 1 - 2
web/apps/photos/src/utils/file/index.ts

@@ -52,7 +52,6 @@ import {
 import { FileTypeInfo } from "types/upload";
 
 import { default as ElectronAPIs } from "@ente/shared/electron";
-import { downloadUsingAnchor } from "@ente/shared/utils";
 import { t } from "i18next";
 import imageProcessor from "services/imageProcessor";
 import { getFileExportPath, getUniqueFileExportName } from "utils/export";
@@ -866,7 +865,7 @@ export const copyFileToClipboard = async (fileUrl: string) => {
             clearTimeout(timeout);
         }
         timeout = setTimeout(
-            () => reject(Error(CustomError.WAIT_TIME_EXCEEDED)),
+            () => reject(new Error("Operation timed out")),
             WAIT_TIME_IMAGE_CONVERSION,
         );
     });

+ 1 - 1
web/apps/photos/src/utils/upload/uploadRetrier.ts

@@ -1,4 +1,4 @@
-import { sleep } from "utils/common";
+import { sleep } from "@ente/shared/utils";
 
 const retrySleepTimeInMilliSeconds = [2000, 5000, 10000];
 

+ 0 - 0
web/packages/shared/hooks/useCastSender.tsx → web/apps/photos/src/utils/useCastSender.tsx


+ 4 - 1
web/packages/accounts/components/ChangeEmail.tsx

@@ -10,6 +10,7 @@ import { sleep } from "@ente/shared/utils";
 import { Alert, Box, TextField } from "@mui/material";
 import { Formik, FormikHelpers } from "formik";
 import { t } from "i18next";
+import { useRouter } from "next/router";
 import { useRef, useState } from "react";
 import { Trans } from "react-i18next";
 import * as Yup from "yup";
@@ -19,7 +20,7 @@ interface formValues {
     ott?: string;
 }
 
-function ChangeEmailForm({ appName, router }: PageProps) {
+function ChangeEmailForm({ appName }: PageProps) {
     const [loading, setLoading] = useState(false);
     const [ottInputVisible, setShowOttInputVisibility] = useState(false);
     const ottInputRef = useRef(null);
@@ -27,6 +28,8 @@ function ChangeEmailForm({ appName, router }: PageProps) {
     const [showMessage, setShowMessage] = useState(false);
     const [success, setSuccess] = useState(false);
 
+    const router = useRouter();
+
     const requestOTT = async (
         { email }: formValues,
         { setFieldError }: FormikHelpers<formValues>,

+ 7 - 5
web/packages/accounts/pages/change-email.tsx

@@ -1,15 +1,17 @@
-import { VerticallyCentered } from "@ente/shared/components/Container";
-import { t } from "i18next";
-import { useEffect } from "react";
-
 import ChangeEmailForm from "@ente/accounts/components/ChangeEmail";
 import { PAGES } from "@ente/accounts/constants/pages";
 import { PageProps } from "@ente/shared/apps/types";
+import { VerticallyCentered } from "@ente/shared/components/Container";
 import FormPaper from "@ente/shared/components/Form/FormPaper";
 import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
 import { getData, LS_KEYS } from "@ente/shared/storage/localStorage";
+import { t } from "i18next";
+import { useRouter } from "next/router";
+import { useEffect } from "react";
+
+function ChangeEmailPage({ appName, appContext }: PageProps) {
+    const router = useRouter();
 
-function ChangeEmailPage({ router, appName, appContext }: PageProps) {
     useEffect(() => {
         const user = getData(LS_KEYS.USER);
         if (!user?.token) {

+ 4 - 1
web/packages/accounts/pages/change-password.tsx

@@ -35,11 +35,14 @@ import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
 import LinkButton from "@ente/shared/components/LinkButton";
 import ComlinkCryptoWorker from "@ente/shared/crypto";
 import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
+import { useRouter } from "next/router";
 
-export default function ChangePassword({ appName, router }: PageProps) {
+export default function ChangePassword({ appName }: PageProps) {
     const [token, setToken] = useState<string>();
     const [user, setUser] = useState<User>();
 
+    const router = useRouter();
+
     useEffect(() => {
         const user = getData(LS_KEYS.USER);
         setUser(user);

+ 12 - 15
web/packages/accounts/pages/credentials.tsx

@@ -24,6 +24,8 @@ import { PAGES } from "../constants/pages";
 import { generateSRPSetupAttributes } from "../services/srp";
 import { logoutUser } from "../services/user";
 
+import { APP_HOMES } from "@ente/shared/apps/constants";
+import { PageProps } from "@ente/shared/apps/types";
 import { VerticallyCentered } from "@ente/shared/components/Container";
 import EnteSpinner from "@ente/shared/components/EnteSpinner";
 import FormPaper from "@ente/shared/components/Form/FormPaper";
@@ -33,7 +35,14 @@ import LinkButton from "@ente/shared/components/LinkButton";
 import VerifyMasterPasswordForm, {
     VerifyMasterPasswordFormProps,
 } from "@ente/shared/components/VerifyMasterPasswordForm";
+import ComlinkCryptoWorker from "@ente/shared/crypto";
+import { B64EncryptionResult } from "@ente/shared/crypto/types";
+import ElectronAPIs from "@ente/shared/electron";
+import { CustomError } from "@ente/shared/error";
+import { addLocalLog } from "@ente/shared/logging";
 import { getAccountsURL } from "@ente/shared/network/api";
+import { logError } from "@ente/shared/sentry";
+import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
 import {
     getToken,
     isFirstLogin,
@@ -41,29 +50,17 @@ import {
 } from "@ente/shared/storage/localStorage/helpers";
 import { KeyAttributes, User } from "@ente/shared/user/types";
 import isElectron from "is-electron";
+import { useRouter } from "next/router";
 import { getSRPAttributes } from "../api/srp";
 import { configureSRP, loginViaSRP } from "../services/srp";
 import { SRPAttributes } from "../types/srp";
-// import { APPS, getAppName } from '@ente/shared/apps';
-import { APP_HOMES } from "@ente/shared/apps/constants";
-import { PageProps } from "@ente/shared/apps/types";
-import ComlinkCryptoWorker from "@ente/shared/crypto";
-import { B64EncryptionResult } from "@ente/shared/crypto/types";
-import ElectronAPIs from "@ente/shared/electron";
-import { CustomError } from "@ente/shared/error";
-import { addLocalLog } from "@ente/shared/logging";
-import { logError } from "@ente/shared/sentry";
-import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
 
-export default function Credentials({
-    appContext,
-    router,
-    appName,
-}: PageProps) {
+export default function Credentials({ appContext, appName }: PageProps) {
     const [srpAttributes, setSrpAttributes] = useState<SRPAttributes>();
     const [keyAttributes, setKeyAttributes] = useState<KeyAttributes>();
     const [user, setUser] = useState<User>();
 
+    const router = useRouter();
     useEffect(() => {
         const main = async () => {
             const user: User = getData(LS_KEYS.USER);

+ 5 - 1
web/packages/accounts/pages/generate.tsx

@@ -29,12 +29,16 @@ import {
     setJustSignedUp,
 } from "@ente/shared/storage/localStorage/helpers";
 import { KeyAttributes, User } from "@ente/shared/user/types";
+import { useRouter } from "next/router";
 
-export default function Generate({ router, appContext, appName }: PageProps) {
+export default function Generate({ appContext, appName }: PageProps) {
     const [token, setToken] = useState<string>();
     const [user, setUser] = useState<User>();
     const [recoverModalView, setRecoveryModalView] = useState(false);
     const [loading, setLoading] = useState(true);
+
+    const router = useRouter();
+
     useEffect(() => {
         const main = async () => {
             const key: string = getKey(SESSION_KEYS.ENCRYPTION_KEY);

+ 4 - 1
web/packages/accounts/pages/login.tsx

@@ -3,13 +3,16 @@ import { VerticallyCentered } from "@ente/shared/components/Container";
 import EnteSpinner from "@ente/shared/components/EnteSpinner";
 import FormPaper from "@ente/shared/components/Form/FormPaper";
 import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
+import { useRouter } from "next/router";
 import { useEffect, useState } from "react";
 import Login from "../components/Login";
 import { PAGES } from "../constants/pages";
 
-export default function LoginPage({ appContext, router, appName }: PageProps) {
+export default function LoginPage({ appContext, appName }: PageProps) {
     const [loading, setLoading] = useState(true);
 
+    const router = useRouter();
+
     useEffect(() => {
         const user = getData(LS_KEYS.USER);
         if (user?.email) {

+ 5 - 1
web/packages/accounts/pages/recover.tsx

@@ -23,13 +23,17 @@ import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
 import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
 import { SESSION_KEYS, getKey } from "@ente/shared/storage/sessionStorage";
 import { KeyAttributes, User } from "@ente/shared/user/types";
+import { useRouter } from "next/router";
+
 const bip39 = require("bip39");
 // mobile client library only supports english.
 bip39.setDefaultWordlist("english");
 
-export default function Recover({ appContext, router, appName }: PageProps) {
+export default function Recover({ appContext, appName }: PageProps) {
     const [keyAttributes, setKeyAttributes] = useState<KeyAttributes>();
 
+    const router = useRouter();
+
     useEffect(() => {
         const user: User = getData(LS_KEYS.USER);
         const keyAttributes: KeyAttributes = getData(LS_KEYS.KEY_ATTRIBUTES);

+ 4 - 1
web/packages/accounts/pages/signup.tsx

@@ -5,11 +5,14 @@ import { PageProps } from "@ente/shared/apps/types";
 import { VerticallyCentered } from "@ente/shared/components/Container";
 import EnteSpinner from "@ente/shared/components/EnteSpinner";
 import FormPaper from "@ente/shared/components/Form/FormPaper";
+import { useRouter } from "next/router";
 import { useEffect, useState } from "react";
 
-export default function SignUpPage({ router, appContext, appName }: PageProps) {
+export default function SignUpPage({ appContext, appName }: PageProps) {
     const [loading, setLoading] = useState(true);
 
+    const router = useRouter();
+
     useEffect(() => {
         const user = getData(LS_KEYS.USER);
         if (user?.email) {

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio