Remove old shipped background

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-08-14 17:21:35 +02:00
parent 9a90351435
commit 8d22d02422
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
3 changed files with 16 additions and 14 deletions

View file

@ -37,8 +37,6 @@ use OCP\IConfig;
class BackgroundService {
const SHIPPED_BACKGROUNDS = [
'flickr-148302424@N05-36591009215.jpg',
'flickr-paszczak000-8715851521.jpg',
'anatoly-mikhaltsov-butterfly-wing-scale.jpg',
'bernie-cetonia-aurata-take-off-composition.jpg',
'dejan-krsmanovic-ribbed-red-metal.jpg',

View file

@ -80,6 +80,19 @@ const background = loadState('dashboard', 'background')
const prefixWithBaseUrl = (url) => generateFilePath('dashboard', '', 'img/') + url
// FIXME: move out duplicate
const getBackgroundUrl = (background, time = 0) => {
if (background === 'default') {
if (window.OCA.Accessibility.theme === 'dark') {
return prefixWithBaseUrl('eduardo-neves-pedra-azul.jpg')
}
return prefixWithBaseUrl('kamil-porembinski-clouds.jpg')
} else if (background === 'custom') {
return generateUrl('/apps/dashboard/background') + '?v=' + time
}
return prefixWithBaseUrl(background)
}
export default {
name: 'App',
components: {
@ -111,15 +124,7 @@ export default {
},
computed: {
backgroundImage() {
if (this.background === 'default') {
if (window.OCA.Accessibility.theme === 'dark') {
return !isMobile ? prefixWithBaseUrl('flickr-148302424@N05-36591009215.jpg?v=1') : prefixWithBaseUrl('flickr-148302424@N05-36591009215-mobile.jpg?v=1')
}
return !isMobile ? prefixWithBaseUrl('flickr-paszczak000-8715851521.jpg?v=1') : prefixWithBaseUrl('flickr-paszczak000-8715851521-mobile.jpg?v=1')
} else if (this.background === 'custom') {
return generateUrl('/apps/dashboard/background') + '?v=' + this.backgroundTime
}
return prefixWithBaseUrl(this.background)
return getBackgroundUrl(this.background, this.backgroundTime)
},
tooltip() {
if (!this.firstRun) {

View file

@ -48,7 +48,6 @@
import axios from '@nextcloud/axios'
import { generateUrl, generateFilePath } from '@nextcloud/router'
import { loadState } from '@nextcloud/initial-state'
import isMobile from '../mixins/isMobile'
const prefixWithBaseUrl = (url) => generateFilePath('dashboard', '', 'img/') + url
const shippedBackgroundList = loadState('dashboard', 'shippedBackgrounds')
@ -56,9 +55,9 @@ const shippedBackgroundList = loadState('dashboard', 'shippedBackgrounds')
const getBackgroundUrl = (background, time = 0) => {
if (background === 'default') {
if (window.OCA.Accessibility.theme === 'dark') {
return !isMobile ? prefixWithBaseUrl('flickr-148302424@N05-36591009215.jpg?v=1') : prefixWithBaseUrl('flickr-148302424@N05-36591009215-mobile.jpg?v=1')
return prefixWithBaseUrl('eduardo-neves-pedra-azul.jpg')
}
return !isMobile ? prefixWithBaseUrl('flickr-paszczak000-8715851521.jpg?v=1') : prefixWithBaseUrl('flickr-paszczak000-8715851521-mobile.jpg?v=1')
return prefixWithBaseUrl('kamil-porembinski-clouds.jpg')
} else if (background === 'custom') {
return generateUrl('/apps/dashboard/background') + '?v=' + time
}