Skip to content

Commit ff49dc6

Browse files
committed
feat: default version
1 parent 12b99d2 commit ff49dc6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ export default function App() {
3030
) ?? '<?php\n// example code\nphpinfo();';
3131

3232
const currentVersion =
33-
asVersion(searchParams.get('v')) ?? versions[versions.length - 1];
33+
asVersion(searchParams.get('v')) ?? '8.2';
3434

3535
function updateVersion(v: Version) {
3636
const currentState = history.state as UrlState | null;
3737
const code = lzstring.decompressFromEncodedURIComponent(
3838
currentState?.c ?? initCode
3939
);
40+
if (code == null) {
41+
return;
42+
}
4043
setSearchParams({
4144
v: v,
4245
c: lzstring.compressToEncodedURIComponent(code),

0 commit comments

Comments
 (0)