fix(#38,#54): fix apiFetch Content-Type header order; fix normalizeAsset seed hash
This commit is contained in:
parent
75c23448b4
commit
33c82cab1a
1 changed files with 2 additions and 2 deletions
|
|
@ -18,7 +18,7 @@ async function apiFetch(path, opts = {}) {
|
|||
const res = await fetch(API + path, {
|
||||
credentials: 'include',
|
||||
...opts,
|
||||
headers: { 'Content-Type': 'application/json', ...(opts.headers || {}) },
|
||||
headers: { ...(opts.headers || {}), 'Content-Type': 'application/json' },
|
||||
});
|
||||
// 401 from any API call means there's no live session. Bounce to the
|
||||
// login screen instead of leaving the app in a half-loaded state.
|
||||
|
|
@ -76,7 +76,7 @@ function normalizeAsset(a, projectMap) {
|
|||
comments: 0,
|
||||
progress: 0,
|
||||
tc: a.start_tc || null,
|
||||
seed: a.id ? a.id.charCodeAt(0) % 6 : 1,
|
||||
seed: a.id ? Array.from(a.id.replace(/-/g, '')).reduce((acc, c) => acc + c.charCodeAt(0), 0) % 6 : 1,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue