Signed-off-by: Julius Härtl <jus@bitgrid.net>
}
public function setShippedBackground($fileName) {
- if (!in_array($fileName, self::SHIPPED_BACKGROUNDS)) {
+ if (!array_key_exists($fileName, self::SHIPPED_BACKGROUNDS)) {
throw new \InvalidArgumentException('The given file name is invalid');
}
$this->config->setUserValue($this->userId, 'dashboard', 'background', $fileName);
async update(data) {
const background = data.type === 'custom' || data.type === 'default' ? data.type : data.value
this.backgroundImage = getBackgroundUrl(background, data.version)
+ if (data.type === 'color') {
+ this.$emit('updateBackground', data)
+ this.loading = false
+ return
+ }
const image = new Image()
image.onload = () => {
this.$emit('updateBackground', data)