ascii art makes everything better
This commit is contained in:
18
src/App.js
18
src/App.js
@@ -52,7 +52,7 @@ export default function App() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (pasteId && state === INITIAL) {
|
if (pasteId && state === INITIAL) {
|
||||||
setState(LOADING);
|
setState(LOADING);
|
||||||
setContent('// Loading, please wait...')
|
setContent('Loading...')
|
||||||
loadFromBytebin(pasteId).then(({ ok, content, type }) => {
|
loadFromBytebin(pasteId).then(({ ok, content, type }) => {
|
||||||
if (ok) {
|
if (ok) {
|
||||||
setContent(content);
|
setContent(content);
|
||||||
@@ -60,7 +60,7 @@ export default function App() {
|
|||||||
setContentType(type);
|
setContentType(type);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setContent('// Unable to load a paste with the id \'' + pasteId + '\'\n// Are you sure it exists? Maybe it expired?');
|
setContent(get404Message(pasteId));
|
||||||
}
|
}
|
||||||
setState(LOADED);
|
setState(LOADED);
|
||||||
})
|
})
|
||||||
@@ -69,3 +69,17 @@ export default function App() {
|
|||||||
|
|
||||||
return <Editor content={content} setContent={setContent} contentType={contentType} />;
|
return <Editor content={content} setContent={setContent} contentType={contentType} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get404Message(pasteId) {
|
||||||
|
return `
|
||||||
|
██╗ ██╗ ██████╗ ██╗ ██╗
|
||||||
|
██║ ██║██╔═████╗██║ ██║
|
||||||
|
███████║██║██╔██║███████║
|
||||||
|
╚════██║████╔╝██║╚════██║
|
||||||
|
██║╚██████╔╝ ██║
|
||||||
|
╚═╝ ╚═════╝ ╚═╝
|
||||||
|
|
||||||
|
not found: '${pasteId}'
|
||||||
|
maybe the paste expired?
|
||||||
|
`;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user