Skip to content

Commit 94012c0

Browse files
authored
Fix all Safari problems with embed (codesandbox#1708)
* Fix all Safari problems with embed * Fix tests * Fix QuotaExceededError issues
1 parent 3494c60 commit 94012c0

File tree

8 files changed

+9
-7
lines changed

8 files changed

+9
-7
lines changed

packages/app/src/app/components/Preview/DevTools/Tabs/elements.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const Container = styled.div`
66
height: 100%;
77
width: 100%;
88
margin-right: 1rem;
9+
overflow: hidden;
910
`;
1011

1112
export const Tabs = styled.div`

packages/app/src/embed/components/App/elements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const Container = styled.div`
1212

1313
export const Fullscreen = styled.div`
1414
width: 100vw;
15-
height: 100vh;
15+
height: 100%;
1616
overflow: hidden;
1717
`;
1818

packages/app/src/embed/components/Sidebar/elements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const Container = styled.div`
77
height: 100%;
88
color: rgba(255, 255, 255, 0.8);
99
z-index: 10;
10-
background-color: ${props => props.theme.background.darken(0.1)};
10+
background-color: ${props => props.theme.sidebar};
1111
overflow: auto;
1212
`;
1313

packages/app/src/embed/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<!-- {{SANDBOX_DATA}} -->
7171
</head>
7272

73-
<body style="margin: 0; padding: 0; background-color: #1C2022; overflow: hidden;">
73+
<body style="margin: 0; padding: 0; background-color: #191d1f; overflow: hidden;">
7474
<!-- Google Tag Manager (noscript) -->
7575
<noscript>
7676
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-T3L6RFK"

packages/app/src/sandbox/eval/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export async function saveCache(
7171
'kb to indexedDB'
7272
);
7373
}
74-
localforage.setItem(manager.id, managerState);
74+
await localforage.setItem(manager.id, managerState);
7575
} catch (e) {
7676
if (process.env.NODE_ENV === 'development') {
7777
console.error(e);

packages/app/src/sandbox/eval/manager.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { flattenDeep, uniq, values } from 'lodash-es';
32
import { Protocol } from 'codesandbox-api';
43
import resolve from 'browser-resolve';
@@ -1167,9 +1166,9 @@ export default class Manager {
11671166
return deleteAPICache(this.id);
11681167
}
11691168

1170-
clearCache() {
1169+
async clearCache() {
11711170
try {
1172-
clearIndexedDBCache();
1171+
await clearIndexedDBCache();
11731172
} catch (ex) {
11741173
if (process.env.NODE_ENV === 'development') {
11751174
console.error(ex);

packages/common/src/__snapshots__/theme.test.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Object {
2727
"redBackground": [Function],
2828
"secondary": [Function],
2929
"shySecondary": [Function],
30+
"sidebar": [Function],
3031
"vscodeTheme": Object {
3132
"$schema": "vscode://schemas/color-theme",
3233
"colors": Object {

packages/common/src/theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const theme = {
7777
redBackground: '#400000',
7878
red: '#F27777',
7979
dangerBackground: '#DC3545',
80+
sidebar: '#191d1f',
8081
}),
8182
vscodeTheme: codesandbox,
8283

0 commit comments

Comments
 (0)