Skip to content

Commit b44161e

Browse files
committed
Show guest profile in scratch paper if not signed in
1 parent 5637c08 commit b44161e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/frontend/components/App/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ class App extends React.Component {
139139
files: [{
140140
name: 'README.md',
141141
content: SCRATCH_PAPER,
142-
contributors: [],
142+
contributors: undefined,
143143
}, {
144144
name: `code.${ext}`,
145145
content: '',
146-
contributors: [],
146+
contributors: undefined,
147147
}],
148148
});
149149
} else if (gistId) {
@@ -189,7 +189,7 @@ class App extends React.Component {
189189
this.props.addFile({
190190
name,
191191
content: '',
192-
contributors: [],
192+
contributors: undefined,
193193
});
194194
}
195195

src/frontend/components/CodeEditor/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'brace/mode/python';
99
import 'brace/theme/tomorrow_night_eighties';
1010
import 'brace/ext/searchbox';
1111
import faTrashAlt from '@fortawesome/fontawesome-free-solid/faTrashAlt';
12+
import faUser from '@fortawesome/fontawesome-free-solid/faUser';
1213
import { tracerManager } from '/core';
1314
import { classes, extension } from '/common/util';
1415
import { actions } from '/reducers';
@@ -88,7 +89,7 @@ class CodeEditor extends React.Component {
8889
<div className={classes(styles.contributors_viewer, className)}>
8990
<span className={classes(styles.contributor, styles.label)}>Contributed by</span>
9091
{
91-
(file.contributors.length ? file.contributors : user ? [user] : []).map(contributor => (
92+
(file.contributors || [user || { login: 'guest', avatar_url: faUser }]).map(contributor => (
9293
<Button className={styles.contributor} icon={contributor.avatar_url} key={contributor.login}
9394
href={`https://github.com/${contributor.login}`}>
9495
{contributor.login}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy