mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Frontend: Fix album events and clipboard
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
@@ -120,8 +120,10 @@ class Clipboard {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = model.getId();
|
||||
this.removeId(model.getId());
|
||||
}
|
||||
|
||||
removeId(id) {
|
||||
if (!this.hasId(id)) return;
|
||||
|
||||
const index = this.selection.indexOf(id);
|
||||
|
||||
@@ -372,9 +372,12 @@
|
||||
for (let i = 0; i < data.entities.length; i++) {
|
||||
const uid = data.entities[i];
|
||||
const index = this.results.findIndex((m) => m.UID === uid);
|
||||
|
||||
if (index >= 0) {
|
||||
this.results.splice(index, 1);
|
||||
}
|
||||
|
||||
this.$clipboard.removeId(uid);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<v-icon>cloud_upload</v-icon>
|
||||
</v-btn>
|
||||
|
||||
<v-btn icon @click.prevent="create" class="action-add">
|
||||
<v-btn icon @click.prevent="create" class="action-add" v-if="staticFilter.type === 'album'">
|
||||
<v-icon>add</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
@@ -487,9 +487,11 @@
|
||||
const values = data.entities[i];
|
||||
const model = this.results.find((m) => m.UID === values.UID);
|
||||
|
||||
for (let key in values) {
|
||||
if (values.hasOwnProperty(key)) {
|
||||
model[key] = values[key];
|
||||
if (model) {
|
||||
for (let key in values) {
|
||||
if (values.hasOwnProperty(key) && values[key] != null && typeof values[key] !== "object") {
|
||||
model[key] = values[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -515,7 +517,8 @@
|
||||
for (let i = 0; i < data.entities.length; i++) {
|
||||
const values = data.entities[i];
|
||||
const index = this.results.findIndex((m) => m.UID === values.UID);
|
||||
if (index === -1) {
|
||||
|
||||
if (index === -1 && this.staticFilter.type === values.Type) {
|
||||
this.results.unshift(new Album(values));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,9 +377,12 @@
|
||||
for (let i = 0; i < data.entities.length; i++) {
|
||||
const uid = data.entities[i];
|
||||
const index = this.results.findIndex((m) => m.UID === uid);
|
||||
|
||||
if (index >= 0) {
|
||||
this.results.splice(index, 1);
|
||||
}
|
||||
|
||||
this.$clipboard.removeId(uid);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user