@operato/board 1.4.64 → 1.4.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/board",
3
- "version": "1.4.64",
3
+ "version": "1.4.66",
4
4
  "description": "Webcomponent for board following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "main": "dist/src/index.js",
@@ -148,5 +148,5 @@
148
148
  "prettier --write"
149
149
  ]
150
150
  },
151
- "gitHead": "47382eb5b652aeb12fc530a9508921824e19aca0"
151
+ "gitHead": "c261bdcf46452491e4090cc7daca332d1ee13301"
152
152
  }
@@ -9,7 +9,7 @@ class BoardDatabase extends Dexie {
9
9
 
10
10
  constructor() {
11
11
  super('operato-board-database')
12
- this.version(1).stores({
12
+ this.version(2).stores({
13
13
  board_data: '[board+refid]',
14
14
  playlist_data: '[playlist]'
15
15
  //...other tables goes here...
@@ -61,7 +61,7 @@ export class BoardDataStorage implements PersistentDataStorage {
61
61
 
62
62
  export class PlaylistStorage implements PersistentDataStorage {
63
63
  public async load(key: String): Promise<any> {
64
- const saved = await db.playlist_data.where({ playlist: key }).first()
64
+ const saved = await db.playlist_data.where({ playlist: key.toString() }).first()
65
65
  return saved?.setting
66
66
  }
67
67
 
@@ -70,6 +70,6 @@ export class PlaylistStorage implements PersistentDataStorage {
70
70
  }
71
71
 
72
72
  public async clear(key: String): Promise<void> {
73
- await db.playlist_data.where({ playlist: key }).delete()
73
+ await db.playlist_data.where({ playlist: key.toString() }).delete()
74
74
  }
75
75
  }
@@ -17,6 +17,7 @@ const DEFAULT_PLAYLIST = String('__default__')
17
17
  export class BoardPlayer extends LitElement {
18
18
  static styles = style
19
19
 
20
+ @property({ type: String }) playlist: string = DEFAULT_PLAYLIST
20
21
  @property({ type: Array }) boards: Array<any> = []
21
22
  @property({ type: Number }) playtime = 30
22
23
  @property({ type: Number }) columns = 1
@@ -67,7 +68,7 @@ export class BoardPlayer extends LitElement {
67
68
  .value=${String(this.playtime)}
68
69
  @change=${(e: Event) => {
69
70
  this.playtime = Number((e.target as HTMLInputElement).value)
70
- this.playlistStorage.save(DEFAULT_PLAYLIST, {
71
+ this.playlistStorage.save(this.playlist, {
71
72
  playtime: this.playtime,
72
73
  columns: this.columns,
73
74
  rows: this.rows
@@ -82,7 +83,7 @@ export class BoardPlayer extends LitElement {
82
83
  .value=${String(this.rows)}
83
84
  @change=${(e: Event) => {
84
85
  this.rows = Number((e.target as HTMLInputElement).value)
85
- this.playlistStorage.save(DEFAULT_PLAYLIST, {
86
+ this.playlistStorage.save(this.playlist, {
86
87
  playtime: this.playtime,
87
88
  columns: this.columns,
88
89
  rows: this.rows
@@ -96,7 +97,7 @@ export class BoardPlayer extends LitElement {
96
97
  .value=${String(this.columns)}
97
98
  @change=${(e: Event) => {
98
99
  this.columns = Number((e.target as HTMLInputElement).value)
99
- this.playlistStorage.save(DEFAULT_PLAYLIST, {
100
+ this.playlistStorage.save(this.playlist, {
100
101
  playtime: this.playtime,
101
102
  columns: this.columns,
102
103
  rows: this.rows
@@ -123,7 +124,7 @@ export class BoardPlayer extends LitElement {
123
124
  }
124
125
 
125
126
  async firstUpdated() {
126
- const setting = await this.playlistStorage.load('DEFAULT_PLAYLIST')
127
+ const setting = await this.playlistStorage.load(this.playlist)
127
128
 
128
129
  if (setting) {
129
130
  const { playtime = 30, columns = 1, rows = 1 } = setting || {}