Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
3f433dab
Commit
3f433dab
authored
5 years ago
by
Jonathan Weth
Committed by
root
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request
#329
from Katharineum/bugfix/offline-fallback
Bugfix/offline fallback
parents
9c3aea5e
a1bb61b5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!86
Merge school-apps
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.idea/misc.xml
+1
-1
1 addition, 1 deletion
.idea/misc.xml
.idea/school-apps.iml
+1
-1
1 addition, 1 deletion
.idea/school-apps.iml
schoolapps/static/common/serviceworker.js
+5
-5
5 additions, 5 deletions
schoolapps/static/common/serviceworker.js
with
7 additions
and
7 deletions
.idea/misc.xml
+
1
−
1
View file @
3f433dab
...
...
@@ -6,5 +6,5 @@
<component
name=
"NodePackageJsonFileManager"
>
<packageJsonPaths
/>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7 (
s
chool
-a
pps)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7 (
S
chool
A
pps)"
project-jdk-type=
"Python SDK"
/>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.idea/school-apps.iml
+
1
−
1
View file @
3f433dab
...
...
@@ -23,7 +23,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/env"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/schoolapps/staticcollect"
/>
</content>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.7 (
s
chool
-a
pps)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.7 (
S
chool
A
pps)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"TemplatesService"
>
...
...
This diff is collapsed.
Click to expand it.
schoolapps/static/common/serviceworker.js
+
5
−
5
View file @
3f433dab
...
...
@@ -97,7 +97,7 @@ function cacheFirstFetch(event) {
// The response was not found in the cache so we look for it on the server
return
fetch
(
event
.
request
)
.
then
(
function
(
response
)
{
// If request was success, add or update it in the cache
// If request was success
ful
, add or update it in the cache
event
.
waitUntil
(
updateCache
(
event
.
request
,
response
.
clone
()));
return
response
;
...
...
@@ -121,12 +121,12 @@ function networkFirstFetch(event) {
event
.
respondWith
(
fetch
(
event
.
request
)
.
then
(
function
(
response
)
{
// If request was success, add or update it in the cache
// If request was success
ful
, add or update it in the cache
event
.
waitUntil
(
updateCache
(
event
.
request
,
response
.
clone
()));
return
response
;
})
.
catch
(
function
(
error
)
{
console
.
log
(
"
[SchoolApps PWA] Network request
F
ailed. Serving content from cache:
"
+
error
);
console
.
log
(
"
[SchoolApps PWA] Network request
f
ailed. Serving content from cache:
"
+
error
);
return
fromCache
(
event
.
request
);
})
);
...
...
@@ -135,11 +135,11 @@ function networkFirstFetch(event) {
function
fromCache
(
request
)
{
// Check to see if you have it in the cache
// Return response
// If not in the cache, then return
error
page
// If not in the cache, then return
offline fallback
page
return
caches
.
open
(
CACHE
).
then
(
function
(
cache
)
{
return
cache
.
match
(
request
).
then
(
function
(
matching
)
{
if
(
!
matching
||
matching
.
status
===
404
)
{
return
Promise
.
reject
(
"
no-match
"
);
return
caches
.
match
(
offlineFallbackPage
);
}
return
matching
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment