Skip to content

Commit 618627d

Browse files
committed
Merge branch 'dev'
2 parents bf8a22c + 2ca6047 commit 618627d

8 files changed

Lines changed: 142 additions & 129 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,12 @@ jobs:
164164

165165
- name: Import keys
166166
run: |
167-
ls -la .
168167
mv ./repo/* ./
169168
mv ./amd64/* ./
170169
rm -rf ./repo
171170
rm -rf ./amd64
172-
ls -la .
173171
chmod +x ./**/*.sh
174172
chmod +x ./**/*.pl
175-
ls -la ./scripts
176-
ls -la ./build || echo ""
177-
ls -la ./build/installers || echo ""
178-
ls -la ./build/installers/linux-unpacked || echo ""
179-
ls -la ./build/installers/linux-unpacked/installers || echo ""
180-
ls -la ./build/installers/linux-unpacked/installers/linux-unpacked || echo ""
181-
pwd
182173
mkdir ./gpg
183174
echo "${{ secrets.GPG_PUB_KEY }}" | base64 -d > ./gpg/pub.key
184175
echo "${{ secrets.GPG_SECRET_KEY }}" | base64 -d > ./gpg/secret.key
@@ -206,26 +197,20 @@ jobs:
206197

207198
- name: Prepare artifacts
208199
run: |
209-
ls -la .
210200
mkdir -p src/build/installers
211201
mv ./repo/* ./src
212202
mv ./amd64/build/installers/* ./src/build/installers/
213203
mv ./arm64v8/* ./src/build/installers/
214204
rm -rf ./repo
215205
rm -rf ./amd64
216206
rm -rf ./arm64v8
217-
ls -la .
218-
ls -la ./src
219-
ls -la ./src/build
220-
ls -la ./src/build/installers
221207
find ./ -type f -iname "*.sh" -exec chmod +x {} \;
222208
find ./ -type f -iname "*.pl" -exec chmod +x {} \;
223209
rm -rf ./src/build/installers/*.deb
224210
rm -rf ./src/build/installers/*.pacman
225211
rm -rf ./src/build/installers/*.rpm
226212
rm -rf ./src/build/installers/*.AppImage
227213
rm -rf ./src/build/installers/linux*
228-
ls -la ./src/build/installers/
229214
230215
- name: Import SSH key
231216
id: key
@@ -303,18 +288,10 @@ jobs:
303288
id: update
304289
run: |
305290
sudo apt install libxml2-utils -y
306-
ls -la .
307-
ls -la ./repo
308-
ls -la ./repo/scripts
309-
ls -la ./flatpak-repo
310-
ls -la ./amd64
311-
ls -la ./arm64v8
312291
mv ./amd64/* ./
313292
mv ./arm64v8/* ./build/installers
314293
rm -rf ./amd64
315294
rm -rf ./arm64v8
316-
ls -la .
317-
ls -la ./build/installers
318295
find ./ -type f -iname "*.sh" -exec chmod +x {} \;
319296
find ./ -type f -iname "*.pl" -exec chmod +x {} \;
320297
cd ./repo
@@ -339,7 +316,7 @@ jobs:
339316
echo 'cat ./flatpak-repo/io.github.Figma_Linux.figma_linux.appdata.xml after update sha sums'
340317
cat ./flatpak-repo/io.github.Figma_Linux.figma_linux.appdata.xml
341318
cat ./flatpak-repo/io.github.Figma_Linux.figma_linux.appdata.xml | tr -d '\n' > /tmp/tmp1
342-
sed -i "s|<releases>|<releases><release version=\"$version\" date=\"$(date '+%Y-%m-%d')\"><description><ul>$data<\/ul><\/description>|g" /tmp/tmp1
319+
sed -i "s|<releases>|<releases><release version=\"$version\" date=\"$(date '+%Y-%m-%d')\"><description><ul>$data<\/ul><\/description><\/release>|g" /tmp/tmp1
343320
echo "Print before formatting /tmp/tmp1 xml file:"
344321
cat /tmp/tmp1
345322
xmllint --format /tmp/tmp1 > ./flatpak-repo/io.github.Figma_Linux.figma_linux.appdata.xml

@types/Common/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ interface Tab {
1111
isInVoiceCall?: boolean;
1212
}
1313

14+
interface TabData {
15+
micAccess: boolean;
16+
view: import("electron").BrowserView;
17+
}
18+
1419
interface SavedTab {
1520
title?: string;
1621
url?: string;

docker/Build_ppa

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,14 @@ RUN cat ./build/figma-linux-${FIGMA_LINUX_VERSION}/debian/changelog && \
1414
chmod a+x ./build/figma-linux-${FIGMA_LINUX_VERSION}/figma-linux && \
1515
chmod a+x ./build/figma-linux-${FIGMA_LINUX_VERSION}/chrome-sandbox && \
1616
chmod a+x ./build/figma-linux-${FIGMA_LINUX_VERSION}/*.sh && \
17-
ls -la ./build/figma-linux-${FIGMA_LINUX_VERSION}/ && \
18-
ls -la ./build/figma-linux-${FIGMA_LINUX_VERSION}/installers || echo '' && \
19-
ls -la ./build/figma-linux-${FIGMA_LINUX_VERSION}/debian || echo '' && \
2017
gpg --import --no-tty --batch --yes ./pub.key && \
2118
gpg --import --no-tty --batch --yes ./secret.key && \
2219
gpg -k && \
2320
cp -rf ./id_rsa ~/.ssh && \
2421
chmod 600 ~/.ssh/id_rsa && \
25-
tar cJf ./build/figma-linux_${FIGMA_LINUX_VERSION}.orig.tar.xz ./build/installers/linux-unpacked/* && \
26-
ls -lah ./build || echo '' && \
27-
ls -lah ./build/installers || echo '' && \
28-
ls -lah ./build/installers/linux-unpacked || echo '' && \
29-
cd build/figma-linux-${FIGMA_LINUX_VERSION} && \
30-
ls -la . || echo '' && \
31-
ls -la installers || echo '' && \
32-
ls -la installers/linux-unpacked || echo '' && \
22+
cd ./build/installers/linux-unpacked && \
23+
tar cJf ../../figma-linux_${FIGMA_LINUX_VERSION}.orig.tar.xz ./* && \
24+
cd ../../figma-linux-${FIGMA_LINUX_VERSION} && \
3325
chmod a+x debian/rules debian/postinst debian/postrm && \
3426
EDITOR=/bin/true dpkg-source -q --commit . patchsetname && \
3527
debuild -S -sa -p"gpg --batch --passphrase-file /usr/src/figma-linux/passphrase --pinentry-mode loopback" && \

scripts/build_ppa.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,4 @@ cp -rf ${linux_unpacked}/* $workdir;
2525
cp -rf ${linux_unpacked}/icons/* $workdir/resources/icon;
2626
cp -rf ./resources/figma-linux.desktop $workdir/resources;
2727

28-
ls -lah ./ || echo '';
29-
ls -lah $workdir || echo '';
30-
ls -lah $workdir/installers || echo '';
31-
ls -lah $workdir/installers/linux-unpacked || echo '';
32-
ls -lah ${linux_unpacked} || echo '';
33-
3428
docker build -t 4tqrgqe5yrgfd/figma-linux-ppa --build-arg FIGMA_LINUX_VERSION=${version} --build-arg FIGMA_LINUX_REV=${rev} -f ./docker/Build_ppa .

src/main/window/Tabs.ts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import WindowManager from "./WindowManager";
88
export default class Tabs {
99
public static registeredCancelCallbackMap: Map<number, () => void> = new Map();
1010

11-
private static tabs: Map<number, E.BrowserView> = new Map();
11+
private static tabs: Map<number, TabData> = new Map();
1212

13-
public static newTab = (url: string, rect: E.Rectangle, preloadScript?: string, save = true): E.BrowserView => {
13+
public static newTab = (url: string, rect: E.Rectangle, preloadScript?: string, save = true): TabData => {
1414
const options: E.BrowserViewConstructorOptions = {
1515
webPreferences: {
1616
nodeIntegration: false,
@@ -53,15 +53,20 @@ export default class Tabs {
5353

5454
isDev && tab.webContents.toggleDevTools();
5555

56+
const data = {
57+
micAccess: false,
58+
view: tab,
59+
};
60+
5661
if (save) {
57-
Tabs.tabs.set(tab.webContents.id, tab);
62+
Tabs.tabs.set(tab.webContents.id, data);
5863
}
5964

60-
return tab;
65+
return data;
6166
};
6267

6368
public static closeAll = (): void => {
64-
Tabs.tabs.forEach((value, id) => {
69+
Tabs.tabs.forEach((_, id) => {
6570
if (id !== 1) {
6671
Tabs.tabs.delete(id);
6772
}
@@ -71,10 +76,10 @@ export default class Tabs {
7176
public static close = (tabId: number): void => {
7277
Tabs.tabs.forEach((value, id) => {
7378
if (id === tabId) {
74-
value.webContents.loadURL("about:blank");
79+
value.view.webContents.loadURL("about:blank");
7580

76-
if (value.webContents && !value.webContents.isDestroyed()) {
77-
value.webContents.destroy();
81+
if (value.view.webContents && !value.view.webContents.isDestroyed()) {
82+
value.view.webContents.destroy();
7883
}
7984

8085
Tabs.tabs.delete(id);
@@ -83,11 +88,11 @@ export default class Tabs {
8388
};
8489

8590
public static reloadAll = (): void =>
86-
Tabs.tabs.forEach(t => (!t.webContents.isDestroyed() ? t.webContents.reload() : ""));
91+
Tabs.tabs.forEach(t => (!t.view.webContents.isDestroyed() ? t.view.webContents.reload() : ""));
8792

88-
public static getTabByIndex = (index: number): E.BrowserView | undefined => {
93+
public static getTabByIndex = (index: number): TabData | undefined => {
8994
let i = 0;
90-
let foundTab: E.BrowserView | undefined;
95+
let foundTab: TabData | undefined;
9196

9297
Tabs.tabs.forEach(tab => {
9398
if (index === i) {
@@ -114,10 +119,18 @@ export default class Tabs {
114119
return i;
115120
};
116121

117-
public static getAll = (): Map<number, E.BrowserView> => Tabs.tabs;
122+
public static getAll = (): Map<number, TabData> => Tabs.tabs;
123+
124+
public static setMicAccess = (webContentsId: number, value: boolean): void => {
125+
Tabs.tabs.forEach((tab, id) => {
126+
if (id === webContentsId) {
127+
tab.micAccess = value;
128+
}
129+
});
130+
};
118131

119-
public static getByWebContentId = (webContentsId: number): E.BrowserView | undefined => {
120-
let foundTab: E.BrowserView | undefined;
132+
public static getByWebContentId = (webContentsId: number): TabData | undefined => {
133+
let foundTab: TabData | undefined;
121134

122135
Tabs.tabs.forEach((tab, id) => {
123136
if (id === webContentsId) {

0 commit comments

Comments
 (0)