mirror of
https://github.com/immich-app/immich.git
synced 2025-11-28 20:09:53 +09:00
fix(web): Handle duplicate library settings gracefully (#6950)
* don't add duplicate import paths * improve library import paths form * same for exclusion patterns * remove newline
This commit is contained in:
committed by
GitHub
parent
90a7f16817
commit
b67fddf4b8
@@ -48,13 +48,16 @@
|
||||
}
|
||||
|
||||
try {
|
||||
library.exclusionPatterns.push(exclusionPatternToAdd);
|
||||
exclusionPatternToAdd = '';
|
||||
|
||||
exclusionPatterns = library.exclusionPatterns;
|
||||
addExclusionPattern = false;
|
||||
// Check so that exclusion pattern isn't duplicated
|
||||
if (!library.exclusionPatterns.includes(exclusionPatternToAdd)) {
|
||||
library.exclusionPatterns.push(exclusionPatternToAdd);
|
||||
exclusionPatterns = library.exclusionPatterns;
|
||||
}
|
||||
} catch (error) {
|
||||
handleError(error, 'Unable to add exclude pattern');
|
||||
handleError(error, 'Unable to add exclusion pattern');
|
||||
} finally {
|
||||
exclusionPatternToAdd = '';
|
||||
addExclusionPattern = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -102,6 +105,7 @@
|
||||
<LibraryExclusionPatternForm
|
||||
submitText="Add"
|
||||
bind:exclusionPattern={exclusionPatternToAdd}
|
||||
{exclusionPatterns}
|
||||
on:submit={handleAddExclusionPattern}
|
||||
on:cancel={() => {
|
||||
addExclusionPattern = false;
|
||||
@@ -112,8 +116,9 @@
|
||||
{#if editExclusionPattern != undefined}
|
||||
<LibraryExclusionPatternForm
|
||||
submitText="Save"
|
||||
canDelete={true}
|
||||
isEditing={true}
|
||||
bind:exclusionPattern={editedExclusionPattern}
|
||||
{exclusionPatterns}
|
||||
on:submit={handleEditExclusionPattern}
|
||||
on:delete={handleDeleteExclusionPattern}
|
||||
on:cancel={() => {
|
||||
|
||||
Reference in New Issue
Block a user