frame: remove dead code in Folder

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/888/head
Varun Patil 2023-10-23 18:57:24 -07:00
parent 4f51e866c4
commit 1439160b50
1 changed files with 10 additions and 41 deletions

View File

@ -5,7 +5,6 @@
:class="{
hasPreview: previews.length > 0,
onePreview: previews.length === 1,
hasError: error,
}"
:to="target"
>
@ -48,13 +47,6 @@ export default defineComponent({
},
},
data: () => ({
// Separate property because the one on data isn't reactive
previews: [] as IPhoto[],
// Error occured fetching thumbs
error: false,
}),
computed: {
/** Open folder */
target() {
@ -70,35 +62,22 @@ export default defineComponent({
},
};
},
},
mounted() {
this.refreshPreviews();
},
previews(): IPhoto[] {
const previews = this.data.previews;
if (!previews?.length) {
return [];
}
watch: {
data() {
this.refreshPreviews();
if (previews.length > 0 && previews.length < 4) {
return [previews[0]];
} else {
return previews.slice(0, 4);
}
},
},
methods: {
/** Refresh previews */
refreshPreviews() {
// Reset state
this.error = false;
// Get preview infos
const previews = this.data.previews;
if (previews) {
if (previews.length > 0 && previews.length < 4) {
this.previews = [previews[0]];
} else {
this.previews = previews.slice(0, 4);
}
}
},
/** Get preview url */
previewUrl(info: IPhoto) {
return utils.getPreviewUrl({
@ -162,16 +141,6 @@ export default defineComponent({
opacity: 0;
}
// Make it red if has an error
.folder.hasError > & {
.folder-icon {
filter: invert(12%) sepia(62%) saturate(5862%) hue-rotate(8deg) brightness(103%) contrast(128%);
}
.name {
color: #bb0000;
}
}
> .folder-icon {
cursor: pointer;
height: 90%;