emoji picker refactoring

This commit is contained in:
Čarodej
2022-01-19 14:04:29 +01:00
parent ea59624091
commit 1342dfa20f
9 changed files with 575 additions and 576 deletions

View File

@@ -14,28 +14,9 @@ class UpdateFolderPropertyAction
// Get folder
$folder = Folder::find($id);
// Set default folder icon
if ($request->input('emoji') === 'default') {
$folder->update([
'emoji' => null,
'color' => null,
]);
}
// Set emoji
if ($request->filled('emoji')) {
$folder->update([
'emoji' => $request->input('emoji'),
'color' => null,
]);
}
// Set color
if ($request->filled('color')) {
$folder->update([
'emoji' => null,
'color' => $request->input('color'),
]);
}
$folder->update([
'emoji' => $request->input('emoji'),
'color' => $request->input('color'),
]);
}
}