Skip to content

Node.js based forum software built for the modern web

392 B
Raw Blame
'use strict';

const meta = require('../../meta');
const widgets = require('../../widgets');

const Themes = module.exports;

Themes.set = async function (socket, data) {
	if (!data) {
		throw new Error('[[error:invalid-data]]');
	}
	if (data.type === 'local') {
		await widgets.saveLocationsOnThemeReset();
	}

	data.ip = socket.ip;
	data.uid = socket.uid;

	await meta.themes.set(data);
};