Merge branch 'main' into cast

This commit is contained in:
Abhinav 2023-11-27 09:54:59 +05:30
commit a5560e1d29
6 changed files with 48 additions and 28 deletions

View file

@ -1,4 +1,11 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "main" ]; then
echo "You can't commit directly to main branch"
exit 1
fi
yarn lint-staged

View file

@ -33,7 +33,7 @@ const TOTPDisplay = ({ issuer, account, code, nextCode, period }) => {
<p
style={{
fontWeight: 'bold',
marginBottom: '0px',
margin: '0px',
fontSize: '14px',
textAlign: 'left',
}}>
@ -41,6 +41,7 @@ const TOTPDisplay = ({ issuer, account, code, nextCode, period }) => {
</p>
<p
style={{
marginTop: '0px',
marginBottom: '8px',
textAlign: 'left',
fontSize: '12px',
@ -52,6 +53,8 @@ const TOTPDisplay = ({ issuer, account, code, nextCode, period }) => {
</p>
<p
style={{
margin: '0px',
marginBottom: '1rem',
fontSize: '24px',
fontWeight: 'bold',
textAlign: 'left',

View file

@ -37,7 +37,7 @@
"formik": "^2.1.5",
"get-user-locale": "^2.1.3",
"hdbscan": "0.0.1-alpha.5",
"heic-convert": "^1.2.4",
"heic-convert": "^2.0.0",
"i18next": "^23.4.1",
"i18next-http-backend": "^2.1.1",
"idb": "^7.1.1",

View file

@ -18,6 +18,7 @@ import { FILE_TYPE } from 'constants/file';
import ComlinkCryptoWorker from '@ente/shared/crypto';
import { Embedding, Model } from 'types/embedding';
import { getToken } from '@ente/shared/storage/localStorage/helpers';
import isElectron from 'is-electron';
const CLIP_EMBEDDING_LENGTH = 512;
@ -48,7 +49,7 @@ class ClipServiceImpl {
}
isPlatformSupported = () => {
return !this.unsupportedPlatform;
return isElectron() && !this.unsupportedPlatform;
};
setupOnFileUploadListener = async () => {
@ -145,6 +146,9 @@ class ClipServiceImpl {
try {
return ElectronAPIs.computeTextEmbedding(text);
} catch (e) {
if (e?.message?.includes(CustomError.UNSUPPORTED_PLATFORM)) {
this.unsupportedPlatform = true;
}
logError(e, 'failed to compute text embedding');
throw e;
}

View file

@ -290,15 +290,21 @@ async function getThingSuggestion(searchPhrase: string): Promise<Suggestion[]> {
}
async function getClipSuggestion(searchPhrase: string): Promise<Suggestion> {
if (!ClipService.isPlatformSupported()) {
try {
if (!ClipService.isPlatformSupported()) {
return null;
}
const clipResults = await searchClip(searchPhrase);
return {
type: SuggestionType.CLIP,
value: clipResults,
label: searchPhrase,
};
} catch (e) {
logError(e, 'getClipSuggestion failed');
return null;
}
const clipResults = await searchClip(searchPhrase);
return {
type: SuggestionType.CLIP,
value: clipResults,
label: searchPhrase,
};
}
function searchCollection(

View file

@ -3138,21 +3138,21 @@ hdbscan@0.0.1-alpha.5:
dependencies:
kd-tree-javascript "^1.0.3"
heic-convert@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/heic-convert/-/heic-convert-1.2.4.tgz#605820f98ace3949a40fc7b263ee0bc573a0176b"
integrity sha512-klJHyv+BqbgKiCQvCqI9IKIvweCcohDuDl0Jphearj8+16+v8eff2piVevHqq4dW9TK0r1onTR6PKHP1I4hdbA==
heic-convert@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/heic-convert/-/heic-convert-2.0.0.tgz#8250d56247310eb1121ef791a4b9ecf2cc0cc2a0"
integrity sha512-Kk2Ue5D7sAhyCmnHPLXQ4tzYH1qINmgppgqFn66x+DmClyL6sdmqGbHJ9cETy0Pxz5Ixz5w5JWJuIv9QqC1oKg==
dependencies:
heic-decode "^1.1.2"
jpeg-js "^0.4.1"
pngjs "^3.4.0"
heic-decode "^2.0.0"
jpeg-js "^0.4.4"
pngjs "^6.0.0"
heic-decode@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/heic-decode/-/heic-decode-1.1.2.tgz#974701666432e31ed64b2263a1ece7cff5218209"
integrity sha512-UF8teegxvzQPdSTcx5frIUhitNDliz/9Pui0JFdIqVRE00spVE33DcCYtZqaLNyd4y5RP/QQWZFIc1YWVKKm2A==
heic-decode@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/heic-decode/-/heic-decode-2.0.0.tgz#77ab96ee1a255f0a9952d0e88d584bca30577114"
integrity sha512-NU+zsiDvdL+EebyTjrEqjkO2XYI7FgLhQzsbmO8dnnYce3S0PBSDm/ZyI4KpcGPXYEdb5W72vp/AQFuc4F8ASg==
dependencies:
libheif-js "^1.10.0"
libheif-js "^1.17.1"
hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2:
version "3.3.2"
@ -3570,7 +3570,7 @@ iterator.prototype@^1.1.2:
reflect.getprototypeof "^1.0.4"
set-function-name "^2.0.1"
jpeg-js@^0.4.1:
jpeg-js@^0.4.4:
version "0.4.4"
resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.4.tgz#a9f1c6f1f9f0fa80cdb3484ed9635054d28936aa"
integrity sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==
@ -3694,7 +3694,7 @@ levn@^0.4.1:
prelude-ls "^1.2.1"
type-check "~0.4.0"
libheif-js@^1.10.0:
libheif-js@^1.17.1:
version "1.17.1"
resolved "https://registry.yarnpkg.com/libheif-js/-/libheif-js-1.17.1.tgz#7772cc5a31098df0354f0fadb49a939030765acd"
integrity sha512-g9wBm/CasGZMjmH3B2sD9+AO7Y5+79F0oPS+sdAulSxQeYeCeiTIP+lDqvlPofD+y76wvfVtotKZ8AuvZQnWgg==
@ -4379,10 +4379,10 @@ piexifjs@^1.0.6:
resolved "https://registry.npmjs.org/piexifjs/-/piexifjs-1.0.6.tgz"
integrity sha512-0wVyH0cKohzBQ5Gi2V1BuxYpxWfxF3cSqfFXfPIpl5tl9XLS5z4ogqhUCD20AbHi0h9aJkqXNJnkVev6gwh2ag==
pngjs@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f"
integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==
pngjs@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-6.0.0.tgz#ca9e5d2aa48db0228a52c419c3308e87720da821"
integrity sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==
postcss@8.4.14:
version "8.4.14"