workflow: reset feature/search-page-improvement branch
This commit is contained in:
@@ -6,7 +6,10 @@ import { socket } from '@/utils/socket'
|
||||
|
||||
const sharedOptions = {
|
||||
gravity: 'bottom',
|
||||
position: 'left'
|
||||
position: 'left',
|
||||
offset: {
|
||||
x: '14rem'
|
||||
}
|
||||
}
|
||||
|
||||
let toastsWithId = {}
|
||||
@@ -84,9 +87,6 @@ export const toast = function(msg, icon = null, dismiss = true, id = null) {
|
||||
delete toastsWithId[id]
|
||||
}
|
||||
}
|
||||
},
|
||||
offset: {
|
||||
x: 'true' === localStorage.getItem('slimSidebar') ? '3rem': '14rem'
|
||||
}
|
||||
}).showToast()
|
||||
if (id) {
|
||||
|
||||
@@ -95,6 +95,28 @@ export function copyToClipboard(text) {
|
||||
ghostInput.remove()
|
||||
}
|
||||
|
||||
export function getProperty(obj, ...props) {
|
||||
for (const prop of props) {
|
||||
// Example: this.is.an.example
|
||||
let hasDotNotation = /\./.test(prop)
|
||||
|
||||
// Searching the properties in the object
|
||||
let valueToTest = hasDotNotation
|
||||
? prop.split('.').reduce((o, i) => {
|
||||
if (o) {
|
||||
return o[i]
|
||||
}
|
||||
}, obj)
|
||||
: obj[prop]
|
||||
|
||||
if (!!valueToTest) {
|
||||
return valueToTest
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export default {
|
||||
isValidURL,
|
||||
convertDuration,
|
||||
|
||||
Reference in New Issue
Block a user