Skip to content

Open source personal finance application

chore: code mistakes refactor

ilkome7fdcb8c0d9da
diff --git a/assets/js/isTouchDevice.js b/assets/js/isTouchDevice.js
index c855f5b2..4d2aff17 100644
--- a/assets/js/isTouchDevice.js
+++ b/assets/js/isTouchDevice.js
@@ -1,8 +1,3 @@
export default function isTouchDevice() {
- if (
- ('ontouchstart' in window)
- || (window.DocumentTouch && document instanceof DocumentTouch))
- return true
-
- return false
+ return !!(('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch))
}
diff --git a/components/base/BottomSheet.vue b/components/base/BottomSheet.vue
index 3dc02861..7ebdb65b 100644
--- a/components/base/BottomSheet.vue
+++ b/components/base/BottomSheet.vue
@@ -27,7 +27,7 @@ export default defineComponent({
// state
const initialY = ref(0)
const clientY = ref(0)
- const isDraging = ref(true)
+ const isDragging = ref(true)
const direction = ref('up')
const isHandler = ref(false)
@@ -165,13 +165,13 @@ export default defineComponent({
const isHasScroll = contentHasScroll(event)
if ((!isTarget || isHasScroll) && !isHandler.value) {
- isDraging.value = false
+ isDragging.value = false
return
}
clientY.value = getClientY(event)
initialY.value = clientY.value + initialY.value
- isDraging.value = true
+ isDragging.value = true
}
/**
@@ -184,17 +184,17 @@ export default defineComponent({
const isHasScroll = contentHasScroll(event)
if (isHasScroll && !isHandler.value) {
- isDraging.value = false
+ isDragging.value = false
initialY.value = 0
clientY.value = 0
return
}
// drug on pc only by nadler drug on mobile everywhere
- // if (isDraging.value && ((!isHandler.value && event.type.includes('touch') || isHandler.value)))
+ // if (isDragging.value && ((!isHandler.value && event.type.includes('touch') || isHandler.value)))
// clientY.value = getClientY(event)
- if (isDraging.value)
+ if (isDragging.value)
clientY.value = getClientY(event)
nextCurrentY.value >= settings.moveToCloseOffset && direction.value === 'down'
@@ -206,7 +206,7 @@ export default defineComponent({
* Drag end
*/
function onDragEnd(): void {
- if (disabled.value || !isDraging.value)
+ if (disabled.value || !isDragging.value)
return
nextCurrentY.value >= settings.moveToCloseOffset && direction.value === 'down'
@@ -219,7 +219,7 @@ export default defineComponent({
*/
function clear() {
clientY.value = 0
- isDraging.value = false
+ isDragging.value = false
}
/**
@@ -300,7 +300,7 @@ export default defineComponent({
* Watch for diff height
*/
watch(diffHeight, () => {
- if (isDraging.value)
+ if (isDragging.value)
return
if (diffHeight.value === 0) {
@@ -340,7 +340,7 @@ export default defineComponent({
drugHeader,
drugStyles,
handler,
- isDraging,
+ isDragging,
maxHeightScroll,
heightScroll,
open,
@@ -358,13 +358,13 @@ export default defineComponent({
)
.overflow(
@click="close()"
- :class="{ _anim: !isDraging && opened, _hidden: !opened }"
+ :class="{ _anim: !isDragging && opened, _hidden: !opened }"
:style="overlayStyles"
)
.drug(
ref="drug"
- :class="{ _anim: !isDraging && opened, _drug: isDraging && drugStyles.transform }"
+ :class="{ _anim: !isDragging && opened, _drug: isDragging && drugStyles.transform }"
:style="drugStyles"
)
.drug__header(ref="drugHeader")
diff --git a/components/categories/Form.vue b/components/categories/Form.vue
index 0665216c..dfb341e7 100644
--- a/components/categories/Form.vue
+++ b/components/categories/Form.vue
@@ -30,10 +30,7 @@ const isUpdateChildCategoriesColor = ref(true)
const isAllowChangeParent = computed(() => {
const childs = getChildCategoriesIds(categoryId.value)
- if (childs)
- return false
-
- return true
+ return !childs
})
/**
diff --git a/components/shared/button/Button.vue b/components/shared/button/Button.vue
index ed02077b..b35f2b0c 100644
--- a/components/shared/button/Button.vue
+++ b/components/shared/button/Button.vue
@@ -60,7 +60,7 @@ export default defineComponent({
&:active:not(._disable)
color var(--c-font-3)
background var(--c-bg-2)
- box-shadow 2px 2px 6px 0px var(--c-bg-2)
+ box-shadow 2px 2px 6px 0 var(--c-bg-2)
&:hover:not(._disable)
@media $media-laptop
diff --git a/components/shared/inputs/Checkbox.vue b/components/shared/inputs/Checkbox.vue
index 6f0b227d..0d96baa3 100644
--- a/components/shared/inputs/Checkbox.vue
+++ b/components/shared/inputs/Checkbox.vue
@@ -39,7 +39,7 @@ export default {
height 20px
background var(--c-font-2)
border-radius $m8
- box-shadow 0px 0px 4px rgba(0, 0, 0, .25)
+ box-shadow 0 0 4px rgba(0, 0, 0, .25)
anim()
/.light &
diff --git a/components/stat/Chart.vue b/components/stat/Chart.vue
index 3cee13e3..40d9567b 100644
--- a/components/stat/Chart.vue
+++ b/components/stat/Chart.vue
@@ -10,12 +10,9 @@ const periods = computed(() => $store.state.chart.periods)
const filter = computed(() => $store.state.filter)
const chartType = computed(() => {
- let type = null
- periods.value[filterPeriodNameAllReplacedToYear.value].grouped
- ? type = 'column'
- : type = 'spline'
-
- return type
+ return periods.value[filterPeriodNameAllReplacedToYear.value].grouped
+ ? 'column'
+ : 'spline'
})
</script>
diff --git a/components/stat/PeriodArrows.vue b/components/stat/PeriodArrows.vue
index f66699f6..2c14f96d 100644
--- a/components/stat/PeriodArrows.vue
+++ b/components/stat/PeriodArrows.vue
@@ -56,7 +56,7 @@ const dates = computed(() => ({
opacity 0
&._left
- left 0px
+ left 0
justify-content flex-start
+media(950px)
@@ -64,7 +64,7 @@ const dates = computed(() => ({
justify-content center
&._right
- right 0px
+ right 0
justify-content flex-end
padding-right 4px
diff --git a/components/stat/cats/PeriodCatsChartItem.vue b/components/stat/cats/PeriodCatsChartItem.vue
index c1a5668f..e8bdd958 100644
--- a/components/stat/cats/PeriodCatsChartItem.vue
+++ b/components/stat/cats/PeriodCatsChartItem.vue
@@ -100,7 +100,7 @@ export default defineComponent({
&__in
position absolute
left 0
- bottom 0px
+ bottom 0
width 100%
min-height 1px
border-radius $m4 $m4 0 0
diff --git a/components/trnForm/TrnForm.vue b/components/trnForm/TrnForm.vue
index d265fed7..1c89db91 100644
--- a/components/trnForm/TrnForm.vue
+++ b/components/trnForm/TrnForm.vue
@@ -410,7 +410,7 @@ function handleSubmitForm() {
.subTitle
color var(--c-font-4)
- letter-spacing 0px
+ letter-spacing 0
font-weight 600
text-transform uppercase
diff --git a/components/trnForm/Trns.vue b/components/trnForm/Trns.vue
index cc7ff38b..00618ea4 100644
--- a/components/trnForm/Trns.vue
+++ b/components/trnForm/Trns.vue
@@ -175,7 +175,7 @@ export default defineComponent({
.subTitle
color var(--c-font-4)
- letter-spacing 0px
+ letter-spacing 0
font-weight 600
text-transform uppercase
</style>
diff --git a/components/trnForm/calculator/useCalculator.ts b/components/trnForm/calculator/useCalculator.ts
index de4718ca..4d3d8a4f 100644
--- a/components/trnForm/calculator/useCalculator.ts
+++ b/components/trnForm/calculator/useCalculator.ts
@@ -189,7 +189,7 @@ export default function useCalculator() {
function formatInput(value: string, isTrimFloatSpaces?: boolean): string {
const formattedArray = separateExpression(String(value))
.map((item) => {
- let formattedItem = ''
+ let formattedItem: string
const isAction = item.match(/[/*\-+]/g)
if (isAction) {
diff --git a/components/welcome/page/Welcome.vue b/components/welcome/page/Welcome.vue
index 3223342b..cd36b4ab 100644
--- a/components/welcome/page/Welcome.vue
+++ b/components/welcome/page/Welcome.vue
@@ -10,10 +10,7 @@ export default {
computed: {
newUserData() {
- if (!this.$store.getters['wallets/hasWallets'] || !this.$store.getters['categories/hasCategories'])
- return true
-
- return false
+ return !this.$store.getters['wallets/hasWallets'] || !this.$store.getters['categories/hasCategories']
},
},