ascii art makes everything better

This commit is contained in:
Luck
2021-03-27 21:23:47 +00:00
parent fb5de272f8
commit 5674f0c8c8

View File

@@ -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?
`;
}