chore(web): change license wording and other things (#11309)

This commit is contained in:
Alex
2024-07-26 10:34:35 -05:00
committed by GitHub
parent bc20710c6d
commit ef7a6bb246
40 changed files with 1045 additions and 518 deletions

View File

@@ -0,0 +1,32 @@
import { preferences } from '$lib/stores/user.store';
import { updateMyPreferences } from '@immich/sdk';
import { DateTime } from 'luxon';
import { get } from 'svelte/store';
export const getButtonVisibility = (): boolean => {
const myPreferences = get(preferences);
if (!myPreferences) {
return true;
}
const { purchase } = myPreferences;
const now = DateTime.now();
const hideUntilDate = DateTime.fromISO(purchase.hideBuyButtonUntil);
const dayLeft = Number(now.diff(hideUntilDate, 'days').days.toFixed(0));
return dayLeft > 0;
};
export const setSupportBadgeVisibility = async (value: boolean) => {
const response = await updateMyPreferences({
userPreferencesUpdateDto: {
purchase: {
showSupportBadge: value,
},
},
});
preferences.set(response);
};