mirror of
https://github.com/immich-app/immich.git
synced 2025-12-10 01:10:21 +03:00
Compare commits
4 Commits
feat/mobil
...
chore/web-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
320651d63f | ||
|
|
8dea3ef74f | ||
|
|
db12568849 | ||
|
|
95da3eb7a0 |
@@ -43,6 +43,7 @@
|
|||||||
public timeGroup = '';
|
public timeGroup = '';
|
||||||
public date!: DateTime;
|
public date!: DateTime;
|
||||||
public hasLabel = false;
|
public hasLabel = false;
|
||||||
|
public hasDotIndicator = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculateSegments = (buckets: AssetBucket[]) => {
|
const calculateSegments = (buckets: AssetBucket[]) => {
|
||||||
@@ -60,6 +61,10 @@
|
|||||||
height = 0;
|
height = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (previous?.date.month !== segment.date.month) {
|
||||||
|
segment.hasDotIndicator = true;
|
||||||
|
}
|
||||||
|
|
||||||
height += segment.height;
|
height += segment.height;
|
||||||
previous = segment;
|
previous = segment;
|
||||||
return segment;
|
return segment;
|
||||||
@@ -164,7 +169,7 @@
|
|||||||
>
|
>
|
||||||
{segment.date.year}
|
{segment.date.year}
|
||||||
</div>
|
</div>
|
||||||
{:else if segment.height > 5}
|
{:else if segment.height > 5 && segment.hasDotIndicator}
|
||||||
<div
|
<div
|
||||||
aria-label={segment.timeGroup + ' ' + segment.count}
|
aria-label={segment.timeGroup + ' ' + segment.count}
|
||||||
class="absolute right-0 mr-3 block h-[4px] w-[4px] rounded-full bg-gray-300"
|
class="absolute right-0 mr-3 block h-[4px] w-[4px] rounded-full bg-gray-300"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ describe('AssetStore', () => {
|
|||||||
|
|
||||||
it('should load buckets in viewport', () => {
|
it('should load buckets in viewport', () => {
|
||||||
expect(sdkMock.getTimeBuckets).toBeCalledTimes(1);
|
expect(sdkMock.getTimeBuckets).toBeCalledTimes(1);
|
||||||
expect(sdkMock.getTimeBuckets).toBeCalledWith({ size: TimeBucketSize.Month });
|
expect(sdkMock.getTimeBuckets).toBeCalledWith({ size: TimeBucketSize.Day });
|
||||||
expect(sdkMock.getTimeBucket).toHaveBeenCalledTimes(2);
|
expect(sdkMock.getTimeBucket).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export class AssetStore {
|
|||||||
options: AssetStoreOptions,
|
options: AssetStoreOptions,
|
||||||
private albumId?: string,
|
private albumId?: string,
|
||||||
) {
|
) {
|
||||||
this.options = { ...options, size: TimeBucketSize.Month };
|
this.options = { ...options, size: TimeBucketSize.Day };
|
||||||
this.store$.set(this);
|
this.store$.set(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ export class AssetStore {
|
|||||||
const updatedBuckets = new Set<AssetBucket>();
|
const updatedBuckets = new Set<AssetBucket>();
|
||||||
|
|
||||||
for (const asset of assets) {
|
for (const asset of assets) {
|
||||||
const timeBucket = DateTime.fromISO(asset.fileCreatedAt).toUTC().startOf('month').toString();
|
const timeBucket = DateTime.fromISO(asset.fileCreatedAt).toUTC().startOf('day').toString();
|
||||||
let bucket = this.getBucketByDate(timeBucket);
|
let bucket = this.getBucketByDate(timeBucket);
|
||||||
|
|
||||||
if (!bucket) {
|
if (!bucket) {
|
||||||
|
|||||||
Reference in New Issue
Block a user