Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

city fetch only once

Manav Rathi552def715379
diff --git a/web/packages/new/photos/services/search/worker.ts b/web/packages/new/photos/services/search/worker.ts
index 2d9f0149a8..c96dd7425b 100644
--- a/web/packages/new/photos/services/search/worker.ts
+++ b/web/packages/new/photos/services/search/worker.ts
@@ -46,8 +46,12 @@ export class SearchWorker {
* session storage so this key needs to be passed to us explicitly.
*/
async sync(masterKey: Uint8Array) {
- // Let the cities fetch complete async.
- void fetchCities().then((cs) => (this.cities = cs));
+ // Let the cities fetch complete async. And do it only once per app
+ // startup (this list is static and doesn't change).
+ if (this.cities.length == 0) {
+ void fetchCities().then((cs) => (this.cities = cs));
+ }
+
return pullUserEntities("location", masterKey)
.then(() => savedLocationTags())
.then((ts) => (this.locationTags = ts));