Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 66a298014b079416c5e267d9d600bd279b7a2e32
  • Loading branch information
Lightspark Eng authored and jklein24 committed Apr 13, 2023
1 parent 7a93f63 commit 689ccb5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/streaming-wallet-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightsparkdev/lightspark-wallet-example",
"version": "0.1.0",
"version": "1.0.1",
"private": true,
"dependencies": {
"@babel/core": "^7.16.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/streaming-wallet-extension/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Lightspark Streaming Money Demo Wallet",
"description": "A Lightspark demo that shows money streaming in real-time using the Lightning Network.",
"version": "1.0.0",
"version": "1.0.1",
"manifest_version": 3,
"action": {
"default_popup": "index.html",
Expand Down
36 changes: 24 additions & 12 deletions examples/streaming-wallet-extension/src/common/streamingTabs.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
const URLS = [
"https://localhost:3000/demos/streaming",
"http://192.168.86.248:3000/demos/streaming",
"https://dev.dev.sparkinfra.net/demos/streaming",
"https://app.lightspark.com/demos/streaming",
];

export const findActiveStreamingDemoTabs = () => {
return new Promise<chrome.tabs.Tab[]>((resolve) => {
chrome.tabs.query(
{
url: [
"https://localhost:3000/demos/streaming",
"http://192.168.86.248:3000/demos/streaming",
"https://dev.dev.sparkinfra.net/demos/streaming",
"https://app.lightspark.com/demos/streaming",
],
},
(tabs) => resolve(tabs)
);
const allAndActive = Promise.all([
new Promise<chrome.tabs.Tab[]>((resolve) => {
chrome.tabs.query({ url: URLS }, (tabs) => resolve(tabs));
}),
new Promise<chrome.tabs.Tab[]>((resolve) => {
chrome.tabs.query(
{ url: URLS, active: true, lastFocusedWindow: true },
(tabs) => resolve(tabs)
);
}),
]);
return allAndActive.then(([all, active]) => {
if (active.length > 0) {
return active;
}
// Reverse the order so that the most recently opened tab is returned.
return all.reverse();
});
};
Empty file removed src/objects/all_entities.ts
Empty file.

0 comments on commit 689ccb5

Please sign in to comment.