refactor(frontend): reduce type errors
This commit is contained in:
parent
2cd32b2248
commit
9e20065496
@ -143,6 +143,7 @@ function top() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function maximize() {
|
function maximize() {
|
||||||
|
if (rootEl.value == null) return;
|
||||||
maximized.value = true;
|
maximized.value = true;
|
||||||
unResizedTop = rootEl.value.style.top;
|
unResizedTop = rootEl.value.style.top;
|
||||||
unResizedLeft = rootEl.value.style.left;
|
unResizedLeft = rootEl.value.style.left;
|
||||||
@ -155,6 +156,7 @@ function maximize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function unMaximize() {
|
function unMaximize() {
|
||||||
|
if (rootEl.value == null) return;
|
||||||
maximized.value = false;
|
maximized.value = false;
|
||||||
rootEl.value.style.top = unResizedTop;
|
rootEl.value.style.top = unResizedTop;
|
||||||
rootEl.value.style.left = unResizedLeft;
|
rootEl.value.style.left = unResizedLeft;
|
||||||
@ -163,6 +165,7 @@ function unMaximize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function minimize() {
|
function minimize() {
|
||||||
|
if (rootEl.value == null) return;
|
||||||
minimized.value = true;
|
minimized.value = true;
|
||||||
unResizedWidth = rootEl.value.style.width;
|
unResizedWidth = rootEl.value.style.width;
|
||||||
unResizedHeight = rootEl.value.style.height;
|
unResizedHeight = rootEl.value.style.height;
|
||||||
@ -171,8 +174,8 @@ function minimize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function unMinimize() {
|
function unMinimize() {
|
||||||
|
if (rootEl.value == null) return;
|
||||||
const main = rootEl.value;
|
const main = rootEl.value;
|
||||||
if (main == null) return;
|
|
||||||
|
|
||||||
minimized.value = false;
|
minimized.value = false;
|
||||||
rootEl.value.style.width = unResizedWidth;
|
rootEl.value.style.width = unResizedWidth;
|
||||||
|
@ -84,6 +84,7 @@ const alwaysMarkNsfw = ref($i.alwaysMarkNsfw);
|
|||||||
const autoSensitive = ref($i.autoSensitive);
|
const autoSensitive = ref($i.autoSensitive);
|
||||||
|
|
||||||
const meterStyle = computed(() => {
|
const meterStyle = computed(() => {
|
||||||
|
if (!capacity.value || !usage.value) return {};
|
||||||
return {
|
return {
|
||||||
width: `${usage.value / capacity.value * 100}%`,
|
width: `${usage.value / capacity.value * 100}%`,
|
||||||
background: tinycolor({
|
background: tinycolor({
|
||||||
|
Loading…
Reference in New Issue
Block a user