mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
feat: add multiple way to show collections and links
This commit is contained in:
12
app/user/lib/index.ts
Normal file
12
app/user/lib/index.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { type DisplayPreferences } from '#shared/types/index';
|
||||
import User from '#user/models/user';
|
||||
|
||||
export function ensureDisplayPreferences(user: User): DisplayPreferences {
|
||||
const defaults: DisplayPreferences = {
|
||||
linkListDisplay: 'grid',
|
||||
collectionListDisplay: 'list',
|
||||
};
|
||||
|
||||
user.displayPreferences = { ...defaults, ...user.displayPreferences };
|
||||
return user.displayPreferences;
|
||||
}
|
||||
Reference in New Issue
Block a user