Skip to content

Commit 2b15932

Browse files
Merge pull request #7 from Snail-IDE/merge-upstream
Merge upstream
2 parents 0189a9e + 655d400 commit 2b15932

File tree

4 files changed

+29
-37
lines changed

4 files changed

+29
-37
lines changed

src/components/tw-studioview/studioview.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ class StudioViewComponent extends React.Component {
6060
}
6161
handleSelect (id) {
6262
this.props.onSelect(id);
63+
/**
64+
* fuck this bullshity ass design paradigm, i cant find where the FUCK this event chain actually ends
65+
* implicitly assume that what ever the fuck happens above will synchronously put the id into the url to be used later
66+
*/
67+
window.location.reload();
6368
}
6469
ref (el) {
6570
this.el = el;

src/containers/home-communication.jsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,14 @@ class HomeCommunication extends React.Component {
2121

2222
componentDidMount() {
2323
window.addEventListener('message', this.wrapperEventHandler);
24-
const iframe = document.createElement('iframe');
25-
iframe.src = `${origin}/embed/editor?external=${encodeURIComponent(window.origin)}`;
26-
iframe.width = 100;
27-
iframe.height = 100;
28-
iframe.style.display = 'none';
29-
document.body.appendChild(iframe);
24+
const iframe = document.getElementById('login');
3025

3126
this.setState({
3227
frame: iframe
3328
});
3429
}
3530
componentWillUnmount() {
3631
window.removeEventListener('message', this.wrapperEventHandler);
37-
const iframe = this.state.frame;
38-
if (iframe) {
39-
iframe.remove();
40-
}
4132
this.setState({
4233
frame: null
4334
});
@@ -46,7 +37,7 @@ class HomeCommunication extends React.Component {
4637
async wrapperEventHandler(e) {
4738
const data = e.data;
4839
// Don't recursively try to run this event.
49-
if (e.origin === window.origin) {
40+
if (e.origin !== 'https://www.snail-ide.com') {
5041
return;
5142
}
5243
if (!data.type) return;

src/lib/tw-project-meta-fetcher-hoc.jsx

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -122,31 +122,27 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
122122
new Date(rawData.date),
123123
rawData.updating === true
124124
);
125-
}
126-
if (rawData.remix > 0) {
127-
// this is a remix, find the original project
128-
fetchProjectMeta(rawData.remix)
129-
.then(remixProject => {
130-
// If project ID changed, ignore the results.
131-
if (this.props.projectId !== projectId) {
132-
return;
133-
}
134-
// If this project is hidden or not approved, ignore the results.
135-
if (
136-
typeof remixProject.name === 'string'
137-
|| typeof remixProject.owner === 'string'
138-
) {
139-
this.props.onSetRemixedProjectInfo(
140-
true, // loaded
141-
remixProject.name,
142-
remixProject.owner
143-
);
144-
}
145-
})
146-
.catch(err => {
147-
// this isnt fatal, just log
148-
log.warn('cannot fetch remixed project meta for this project;', err);
149-
});
125+
126+
if (String(rawData.remix) !== '0') {
127+
// this is a remix, find the original project
128+
fetchProjectMeta(rawData.remix)
129+
.then(remixProject => {
130+
// If this project is hidden or not approved, ignore the results.
131+
if (
132+
typeof remixProject.name === 'string'
133+
|| typeof remixProject.owner === 'string'
134+
) {
135+
this.props.onSetRemixedProjectInfo(
136+
true, // loaded
137+
remixProject.name,
138+
remixProject.owner
139+
);
140+
}
141+
}).catch(err => {
142+
// this isnt fatal, just log
143+
log.warn('cannot fetch remixed project meta for this project;', err);
144+
});
145+
}
150146
}
151147
setIndexable(true);
152148
})

src/playground/addon-settings.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import appTarget from './app-target';
2222

2323
const onExportSettings = settings => {
2424
const blob = new Blob([JSON.stringify(settings)]);
25-
downloadBlob('turbowarp-addon-settings.json', blob);
25+
downloadBlob('penguinmod-addon-settings.json', blob);
2626
};
2727

2828
ReactDOM.render((

0 commit comments

Comments
 (0)