refactor: remove return from small lambdas
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/900/head
parent
f7de4fe492
commit
1b378334f5
|
@ -281,18 +281,16 @@ export default defineComponent({
|
||||||
let prevMonth = 0;
|
let prevMonth = 0;
|
||||||
|
|
||||||
// Get a new tick
|
// Get a new tick
|
||||||
const getTick = (dayId: number, isMonth = false, text?: string | number): ITick => {
|
const getTick = (dayId: number, isMonth = false, text?: string | number): ITick => ({
|
||||||
return {
|
dayId,
|
||||||
dayId,
|
isMonth,
|
||||||
isMonth,
|
text,
|
||||||
text,
|
y: 0,
|
||||||
y: 0,
|
count: 0,
|
||||||
count: 0,
|
topF: 0,
|
||||||
topF: 0,
|
top: 0,
|
||||||
top: 0,
|
s: false,
|
||||||
s: false,
|
});
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// Iterate over rows
|
// Iterate over rows
|
||||||
for (const row of this.rows) {
|
for (const row of this.rows) {
|
||||||
|
|
|
@ -660,9 +660,7 @@ export default defineComponent({
|
||||||
|
|
||||||
// Clear everything else in front
|
// Clear everything else in front
|
||||||
Array.from(this.selection.values())
|
Array.from(this.selection.values())
|
||||||
.filter((p: IPhoto) => {
|
.filter((p: IPhoto) => (this.isreverse ? p.dayid > photo.dayid : p.dayid < photo.dayid))
|
||||||
return this.isreverse ? p.dayid > photo.dayid : p.dayid < photo.dayid;
|
|
||||||
})
|
|
||||||
.forEach((photo: IPhoto) => {
|
.forEach((photo: IPhoto) => {
|
||||||
this.selectPhoto(photo, false, true);
|
this.selectPhoto(photo, false, true);
|
||||||
updateDaySet.add(photo.dayid);
|
updateDaySet.add(photo.dayid);
|
||||||
|
|
|
@ -38,14 +38,12 @@ export default defineComponent({
|
||||||
CloseIcon,
|
CloseIcon,
|
||||||
},
|
},
|
||||||
|
|
||||||
data: () => {
|
data: () => ({
|
||||||
return {
|
nativeOpen: false,
|
||||||
nativeOpen: false,
|
reducedOpen: false,
|
||||||
reducedOpen: false,
|
basename: '',
|
||||||
basename: '',
|
lastKnownWidth: 0,
|
||||||
lastKnownWidth: 0,
|
}),
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
refs() {
|
refs() {
|
||||||
|
|
|
@ -1049,13 +1049,11 @@ export default defineComponent({
|
||||||
|
|
||||||
// Create justified layout with correct params
|
// Create justified layout with correct params
|
||||||
const justify = getLayout(
|
const justify = getLayout(
|
||||||
day.detail.map((p) => {
|
day.detail.map((p) => ({
|
||||||
return {
|
width: p.w || this.rowHeight,
|
||||||
width: p.w || this.rowHeight,
|
height: p.h || this.rowHeight,
|
||||||
height: p.h || this.rowHeight,
|
forceSquare: false,
|
||||||
forceSquare: false,
|
})),
|
||||||
};
|
|
||||||
}),
|
|
||||||
{
|
{
|
||||||
rowWidth: this.rowWidth,
|
rowWidth: this.rowWidth,
|
||||||
rowHeight: this.rowHeight,
|
rowHeight: this.rowHeight,
|
||||||
|
|
|
@ -34,13 +34,11 @@ export default defineComponent({
|
||||||
error: (error: Error) => true,
|
error: (error: Error) => true,
|
||||||
},
|
},
|
||||||
|
|
||||||
data: () => {
|
data: () => ({
|
||||||
return {
|
dataSrc: BLANK_IMG,
|
||||||
dataSrc: BLANK_IMG,
|
_blobLocked: false,
|
||||||
_blobLocked: false,
|
_state: 0,
|
||||||
_state: 0,
|
}),
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
src() {
|
src() {
|
||||||
|
|
|
@ -182,12 +182,10 @@ export default defineComponent({
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const q = window.encodeURIComponent(this.searchBar);
|
const q = window.encodeURIComponent(this.searchBar);
|
||||||
axios
|
axios
|
||||||
.get(`https://nominatim.openstreetmap.org/search.php?q=${q}&format=jsonv2`)
|
.get<NLocation[]>(`https://nominatim.openstreetmap.org/search.php?q=${q}&format=jsonv2`)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.options = response.data.filter((x: NLocation) => {
|
this.options = response.data.filter((x) => x.lat && x.lon && x.display_name);
|
||||||
return x.lat && x.lon && x.display_name;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
|
@ -109,12 +109,10 @@ export default defineComponent({
|
||||||
|
|
||||||
mixins: [UserConfig, ModalMixin],
|
mixins: [UserConfig, ModalMixin],
|
||||||
|
|
||||||
data: () => {
|
data: () => ({
|
||||||
return {
|
photo: null as IPhoto | null,
|
||||||
photo: null as IPhoto | null,
|
loading: 0,
|
||||||
loading: 0,
|
}),
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
console.assert(!_m.modals.sharePhoto, 'ShareModal created twice');
|
console.assert(!_m.modals.sharePhoto, 'ShareModal created twice');
|
||||||
|
|
Loading…
Reference in New Issue