mirror of
https://github.com/TeamPiped/Piped.git
synced 2026-03-15 21:17:01 +00:00
feat: add to channel group modal on channel page
This commit is contained in:
25
src/main.js
25
src/main.js
@@ -247,11 +247,26 @@ const mixin = {
|
||||
elem.click();
|
||||
elem.remove();
|
||||
},
|
||||
getChannelGroupsCursor() {
|
||||
if (!window.db) return;
|
||||
var tx = window.db.transaction("channel_groups", "readonly");
|
||||
var store = tx.objectStore("channel_groups");
|
||||
return store.index("groupName").openCursor();
|
||||
async getChannelGroups() {
|
||||
return new Promise(resolve => {
|
||||
let channelGroups = [];
|
||||
var tx = window.db.transaction("channel_groups", "readonly");
|
||||
var store = tx.objectStore("channel_groups");
|
||||
const cursor = store.index("groupName").openCursor();
|
||||
cursor.onsuccess = e => {
|
||||
const cursor = e.target.result;
|
||||
if (cursor) {
|
||||
const group = cursor.value;
|
||||
channelGroups.push({
|
||||
groupName: group.groupName,
|
||||
channels: JSON.parse(group.channels),
|
||||
});
|
||||
cursor.continue();
|
||||
} else {
|
||||
resolve(channelGroups);
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
createOrUpdateChannelGroup(group) {
|
||||
var tx = window.db.transaction("channel_groups", "readwrite");
|
||||
|
||||
Reference in New Issue
Block a user