Fixed lodash library not invoking in production build (#171)

* Added staging docker-compose file
* Use lodash-es and remove hydration option on photos page fixed the problem
This commit is contained in:
Alex
2022-05-22 04:48:38 -05:00
committed by GitHub
parent baaf7ad153
commit ce06af0c9b
8 changed files with 163 additions and 22 deletions

View File

@@ -1,17 +1,22 @@
import { writable, derived } from 'svelte/store';
import { getRequest } from '$lib/api';
import type { ImmichAsset } from '$lib/models/immich-asset'
import * as _ from 'lodash';
import lodash from 'lodash-es';
import moment from 'moment';
const assets = writable<ImmichAsset[]>([]);
const assetsGroupByDate = derived(assets, ($assets) => {
return _.chain($assets)
.groupBy((a) => moment(a.createdAt).format('ddd, MMM DD'))
.sortBy((group) => $assets.indexOf(group[0]))
.value();
try {
return lodash.chain($assets)
.groupBy((a) => moment(a.createdAt).format('ddd, MMM DD'))
.sortBy((group) => $assets.indexOf(group[0]))
.value();
} catch (e) {
console.log("error deriving state assets", e)
return []
}
})