Feat(studio): add possibility to directly write into the theme files

This commit is contained in:
Pieter Vander Vennet 2024-09-25 11:40:45 +02:00
parent ea133c5eff
commit 0be7c64ea1
3 changed files with 39 additions and 28 deletions

View file

@ -18,8 +18,9 @@ export default class StudioServer {
| { error: any }
| undefined
>
public isDirect: boolean
constructor(url: string, userId: Store<number>) {
constructor(url: string, userId: Store<number | undefined>, isDirect: boolean) {
this.url = url
this._userId = userId
this.overview = UIEventSource.FromPromiseWithErr(this.fetchOverviewRaw())
@ -123,7 +124,7 @@ export default class StudioServer {
public urlFor(id: string, category: "layers" | "themes", uid?: number) {
uid ??= this._userId.data
const uidStr = uid !== undefined ? "/" + uid : ""
const uidStr = uid !== null ? "/" + uid : ""
return `${this.url}${uidStr}/${category}/${id}/${id}.json`
}
}