Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Commit 0336dfa

Browse files
committed
Update packing to include logo
1 parent e08aeaa commit 0336dfa

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

extension/logo128.png

1.23 KB
Loading

extension/manifest.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 2,
33

44
"name": "Sail",
5-
"version": "1.0.5",
5+
"version": "1.0.9",
66
"author": "Coder",
77
"description": "Work in immutable, pre-configured development environments.",
88

@@ -26,6 +26,9 @@
2626
"permissions": [
2727
"nativeMessaging"
2828
],
29+
"icons": {
30+
"128": "logo128.png"
31+
},
2932
"browser_action": {
3033
"default_title": "Sail",
3134
"default_popup": "out/popup.html"

extension/pack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
zip -R extension manifest.json out/*
3+
zip -R extension manifest.json out/* logo128.png

extension/src/content.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const doConnection = (socketUrl: string, projectUrl: string, onMessage: (data: {
2323
return;
2424
}
2525
const type = data.type;
26-
const content = atob(data.v);
26+
const content = type === "data" ? atob(data.v) : data.v;
2727

2828
switch (type) {
2929
case "data":
@@ -121,6 +121,14 @@ const ensureButton = (): void | HTMLElement => {
121121
if (data.type === "data") {
122122
text.innerText += data.v;
123123
term.scrollTop = term.scrollHeight;
124+
} else if (data.type === "error") {
125+
text.innerText += data.v;
126+
term.scrollTop = term.scrollHeight;
127+
setTimeout(() => {
128+
btn.innerText = "Open in Sail";
129+
btn.classList.remove("disabled");
130+
term.remove();
131+
}, 5000);
124132
}
125133
});
126134
}).then((socket) => {
@@ -141,10 +149,8 @@ const ensureButton = (): void | HTMLElement => {
141149

142150
requestSail().then(() => (button as HTMLElement).classList.remove("disabled"))
143151
.catch((ex) => {
144-
if (ex.toString().indexOf("host not found") !== -1) {
145-
(button as HTMLElement).style.opacity = "0.5";
146-
(button as HTMLElement).title = "Setup Sail using the extension icon in the top-right!";
147-
}
152+
(button as HTMLElement).style.opacity = "0.5";
153+
(button as HTMLElement).title = "Setup Sail using the extension icon in the top-right!";
148154
});
149155
}
150156

extension/src/popup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ requestSail().then((url) => {
99
}).catch((ex) => {
1010
const has = (str: string) => ex.toString().indexOf(str) !== -1;
1111

12-
if (has("not found")) {
12+
if (has("not found") || has("forbidden")) {
1313
document.body.innerText = "After installing sail, run `sail install-for-chrome-ext`.";
1414
} else {
1515
document.body.innerText = ex.toString();

0 commit comments

Comments
 (0)