feat: minor changes

This commit is contained in:
Pietro Tamburini 2024-04-29 16:01:01 +02:00
parent 434e49bf59
commit 27350f27ba
No known key found for this signature in database
GPG Key ID: FDD41DE51E2B1ABB
8 changed files with 14 additions and 17 deletions

View File

@ -53,6 +53,7 @@ bump-version: $(standard-version) ## Bump app version
$Q ./scripts/bump_version.sh
## Help:
.DEFAULT_GOAL := help
help: ## Show this help
@echo ''
@echo 'Usage:'

View File

@ -40,9 +40,7 @@ async function resourceAction(url: string, method: ApiMethod, content?: any) {
opts.body = content;
}
const res = await fetchURL(`/api/resources${url}`, opts);
return res;
return await fetchURL(`/api/resources${url}`, opts);
}
export async function remove(url: string) {

View File

@ -142,7 +142,7 @@
<script>
import { mapActions, mapState } from "pinia";
import { useFileStore } from "@/stores/file";
import { share as api, pub as pub_api } from "@/api";
import { pub as pub_api, share as api } from "@/api";
import dayjs from "dayjs";
import { useLayoutStore } from "@/stores/layout";
import { copy } from "@/utils/clipboard";
@ -182,11 +182,10 @@ export default {
},
async beforeMount() {
try {
const links = await api.get(this.url);
this.links = links;
this.links = await api.get(this.url);
this.sort();
if (this.links.length == 0) {
if (this.links.length === 0) {
this.listing = false;
}
} catch (e) {
@ -234,7 +233,7 @@ export default {
await api.remove(link.hash);
this.links = this.links.filter((item) => item.hash !== link.hash);
if (this.links.length == 0) {
if (this.links.length === 0) {
this.listing = false;
}
} catch (e) {
@ -263,7 +262,7 @@ export default {
});
},
switchListing() {
if (this.links.length == 0 && !this.listing) {
if (this.links.length === 0 && !this.listing) {
this.closeHovers();
}

View File

@ -1,8 +1,7 @@
.button {
outline: 0;
border: 0;
padding: 0.5em 1em;
border-radius: 0.1em;
border-radius: 0.25em;
cursor: pointer;
background: var(--blue);
color: white;

View File

@ -2,7 +2,7 @@
background: var(--surfacePrimary);
color: var(--textSecondary);
border: 1px solid var(--borderPrimary);
border-radius: 0.1em;
border-radius: 0.35em;
padding: 0.5em 1em;
transition: 0.2s ease all;
margin: 0;

View File

@ -161,7 +161,7 @@ table tr > *:last-child {
margin: 0 0 1rem 0;
background: var(--surfacePrimary);
color: var(--textSecondary);
border-radius: 2px;
border-radius: 7px;
box-shadow:
0 2px 2px 0 rgba(0, 0, 0, 0.14),
0 1px 5px 0 rgba(0, 0, 0, 0.12),

View File

@ -93,7 +93,7 @@ html[dir="rtl"] #listing {
width: calc(33% - 1em);
margin: 0.5em;
padding: 0.5em;
border-radius: 0.2em;
border-radius: 0.5em;
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.06),
0 1px 2px rgba(0, 0, 0, 0.12);

View File

@ -444,7 +444,7 @@ watch(req, () => {
onMounted(() => {
// Check the columns size for the first time.
colunmsResize();
columnsResize();
// How much every listing item affects the window height
setItemWeight();
@ -638,7 +638,7 @@ const paste = (event: Event) => {
action(overwrite, rename);
};
const colunmsResize = () => {
const columnsResize = () => {
// Update the columns size based on the window width.
let items_ = css(["#listing.mosaic .item", ".mosaic#listing .item"]);
if (items_ === null) return;
@ -846,7 +846,7 @@ const toggleMultipleSelection = () => {
};
const windowsResize = throttle(() => {
colunmsResize();
columnsResize();
width.value = window.innerWidth;
// Listing element is not displayed