Fix tag edit list not refreshing when toggling tags

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent e61624ce6e
commit 1d0ca6bb8e

@ -1580,8 +1580,8 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "mediarepo-api"
version = "0.4.1"
source = "git+https://github.com/Trivernis/mediarepo-api.git?rev=b123e69d92dfd384d37b9005c8e261c69fddfcc5#b123e69d92dfd384d37b9005c8e261c69fddfcc5"
version = "0.4.2"
source = "git+https://github.com/Trivernis/mediarepo-api.git?rev=28b25e94eb2cdb8cec86e3e452081a649b8cd64e#28b25e94eb2cdb8cec86e3e452081a649b8cd64e"
dependencies = [
"async-trait",
"chrono",

@ -30,7 +30,7 @@ features = ["env-filter"]
[dependencies.mediarepo-api]
git = "https://github.com/Trivernis/mediarepo-api.git"
rev = "b123e69d92dfd384d37b9005c8e261c69fddfcc5"
rev = "28b25e94eb2cdb8cec86e3e452081a649b8cd64e"
features = ["tauri-plugin"]
[features]

@ -125,12 +125,7 @@ export class FileEditComponent implements OnInit, OnChanges {
[tag.id], []);
}
}
if (this.tags.findIndex(t => t.getNormalizedOutput() === tag.getNormalizedOutput()) < 0) {
this.tags.push(tag);
this.tags = this.tags.sort(
(a, b) => a.getNormalizedOutput().localeCompare(b.getNormalizedOutput()));
this.tags = [...this.tags]; // angular pls detect it wtf
}
this.mapFileTagsToTagList();
const index = this.tags.indexOf(tag);
index >= 0 && this.tagScroll.scrollToIndex(index);
}
@ -142,11 +137,7 @@ export class FileEditComponent implements OnInit, OnChanges {
[], [tag.id]);
}
}
const index = this.tags.indexOf(tag);
if (index >= 0) {
this.tags.splice(index, 1);
this.tags = [...this.tags]; // so angular detects the change
}
this.mapFileTagsToTagList();
}
private filterSuggestionTag(tag: string) {

Loading…
Cancel
Save