π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Clean
Manav Rathi0d079fc59395
diff --git a/web/apps/photos/src/components/SearchBar.tsx b/web/apps/photos/src/components/SearchBar.tsxindex 340f8436b1..eea5049b62 100644--- a/web/apps/photos/src/components/SearchBar.tsx+++ b/web/apps/photos/src/components/SearchBar.tsx@@ -1,3 +1,4 @@+import { assertionFailed } from "@/base/assert";import { useIsMobileWidth } from "@/base/hooks";import { FileType } from "@/media/file-type";import { PeopleList } from "@/new/photos/components/PeopleList";@@ -425,11 +426,13 @@ interface EmptyStateProps {* The view shown in the menu area when the user has not typed anything in the* search box.*/-const EmptyState: React.FC<EmptyStateProps> = (props) => {- const status = isMLSupported && mlStatusSnapshot();+const EmptyState: React.FC<EmptyStateProps> = () => {+ const status = mlStatusSnapshot();- if (!isMLSupported) return null;- if (!status || status.phase == "disabled") return null;+ if (!status || status.phase == "disabled") {+ assertionFailed();+ return <></>;+ }let label: string;switch (status.phase) {@@ -502,18 +505,8 @@ const EmptyState: React.FC<EmptyStateProps> = (props) => {// {props.children}// </SelectComponents.Menu>// );-- return <></>;- return (- <div>- <h1>Hello</h1>- <p>{(console.log(props), props.toString())}</p>- </div>- );};-export async function getMLStatusSuggestion(): Promise<Suggestion> {}-const Option: React.FC<OptionProps<SearchOption, false>> = (props) => (<SelectComponents.Option {...props}><LabelWithInfo data={props.data} />diff --git a/web/packages/base/assert.ts b/web/packages/base/assert.tsindex e20b7d1e43..6f4743e7db 100644--- a/web/packages/base/assert.ts+++ b/web/packages/base/assert.ts@@ -4,8 +4,12 @@ import log from "./log";/*** If running in a dev build, throw an exception with the given message.* Otherwise log it as a warning.+ *+ * @param message An optional message to use for the failure. If not provided,+ * then a generic one is used.*/-export const assertionFailed = (message: string) => {+export const assertionFailed = (message?: string) => {+ message = message ?? "Assertion failed";if (isDevBuild) throw new Error(message);log.warn(message);};