-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1b209d
commit 6c6c9d4
Showing
14 changed files
with
128 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ assignees: '' | |
## 버그 작업 브랜치 | ||
|
||
## ☑ Bug Fix TODOS | ||
|
||
- [ ] 작업 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,11 @@ labels: Feature | |
assignees: '' | ||
|
||
--- | ||
|
||
## 🚀 어떤 기능을 만드나요? | ||
|
||
## 작업 중인 브랜치 | ||
|
||
## ☑ Implement TODO | ||
|
||
- [ ] 작업 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,10 @@ assignees: '' | |
|
||
--- | ||
|
||
|
||
## ✨ 어떤 Style 작업인가요? | ||
|
||
## 스타일 작업 브랜치 | ||
|
||
## ☑ Style TODO | ||
|
||
- [ ] 작업 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
## 이슈번호 | ||
|
||
<!-- - close 뒤에 이슈 달아주기 --> | ||
close: # | ||
|
||
## 작업 내용 설명 | ||
|
||
<!-- 스크린샷 및 작업내용을 적어주세요 --> | ||
- | ||
|
||
## 리뷰어에게 한마디 | ||
|
||
<!-- 리뷰어들이 참고해야 하는 사항을 적어주세요 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<!doctype html> | ||
<html lang="ko"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="mobile-web-app-capable" content="yes"> | ||
<link rel="manifest" href="/manifest.json"> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>CoffeeMeet</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta content="yes" name="mobile-web-app-capable"> | ||
<link href="/manifest.json" rel="manifest"> | ||
<link href="/favicon.svg" rel="icon" type="image/svg+xml" /> | ||
<meta content="width=device-width, initial-scale=1.0" name="viewport" /> | ||
<title>CoffeeMeet</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script src="/src/main.tsx" type="module"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,63 @@ | ||
self.addEventListener('install', function (e) { | ||
console.log('fcm sw install..') | ||
self.skipWaiting() | ||
}) | ||
|
||
self.addEventListener('activate', function (e) { | ||
console.log('fcm sw activate..') | ||
}) | ||
|
||
self.addEventListener('push', function (e) { | ||
console.log('push: ', e.data.json()) | ||
if (!e.data.json()) return | ||
self.addEventListener("install", function (e) { | ||
console.log("fcm sw install.."); | ||
self.skipWaiting(); | ||
}); | ||
|
||
self.addEventListener("activate", function (e) { | ||
console.log("fcm sw activate.."); | ||
}); | ||
|
||
self.addEventListener("push", function (e) { | ||
console.log("push: ", e.data.json()); | ||
if (!e.data.json()) { | ||
return; | ||
} | ||
|
||
const resultData = e.data.json().notification | ||
const notificationTitle = resultData.title | ||
const resultData = e.data.json().notification; | ||
const notificationTitle = resultData.title; | ||
const notificationOptions = { | ||
body: resultData.body, | ||
icon: resultData.image, | ||
tag: resultData.tag, | ||
...resultData, | ||
} | ||
self.registration.showNotification(notificationTitle, notificationOptions) | ||
console.log('push: ', { resultData, notificationTitle, notificationOptions }) | ||
}; | ||
self.registration.showNotification(notificationTitle, notificationOptions); | ||
console.log("push: ", { resultData, notificationTitle, notificationOptions }); | ||
//indexedDB에 상태 저장하는 기능 추가 | ||
saveDataToIndexedDB('isMatchingSuccess', true) | ||
}) | ||
saveDataToIndexedDB("isMatchingSuccess", true); | ||
}); | ||
|
||
// IndexedDB에 데이터를 저장하는 함수 | ||
function saveDataToIndexedDB(key, value) { | ||
const request = indexedDB.open('matching-database') | ||
const request = indexedDB.open("matching-database"); | ||
|
||
request.onupgradeneeded = function (event) { | ||
const db = event.target.result | ||
const db = event.target.result; | ||
|
||
db.createObjectStore('my-store', { autoIncrement: true }) | ||
} | ||
db.createObjectStore("my-store", { autoIncrement: true }); | ||
}; | ||
|
||
request.onsuccess = function (event) { | ||
const db = event.target.result | ||
const tx = db.transaction('my-store', 'readwrite') | ||
const store = tx.objectStore('my-store') | ||
store.put(value, key) | ||
const db = event.target.result; | ||
const tx = db.transaction("my-store", "readwrite"); | ||
const store = tx.objectStore("my-store"); | ||
store.put(value, key); | ||
|
||
tx.oncomplete = function () { | ||
db.close() | ||
} | ||
} | ||
db.close(); | ||
}; | ||
}; | ||
|
||
request.onerror = function (event) { | ||
console.error('Error opening IndexedDB:', event.target.error) | ||
} | ||
console.error("Error opening IndexedDB:", event.target.error); | ||
}; | ||
} | ||
|
||
self.addEventListener('notificationclick', function (event) { | ||
console.log('notification click') | ||
const url = '/' | ||
event.notification.close() | ||
self.addEventListener("notificationclick", function (event) { | ||
console.log("notification click"); | ||
const url = "/"; | ||
event.notification.close(); | ||
|
||
// eslint-disable-next-line no-undef | ||
event.waitUntil(clients.openWindow(url)) | ||
}) | ||
event.waitUntil(clients.openWindow(url)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"short_name": "CoffeeMeet", | ||
"name": "CoffeeMeet", | ||
"icons": [ | ||
{ | ||
"src": "coffee.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
} | ||
], | ||
"start_url": "/index.html", | ||
"display": "standalone", | ||
"orientation": "landscape" | ||
} | ||
"short_name": "CoffeeMeet", | ||
"name": "CoffeeMeet", | ||
"icons": [ | ||
{ | ||
"src": "coffee.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
} | ||
], | ||
"start_url": "/index.html", | ||
"display": "standalone", | ||
"orientation": "landscape" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
const timerState = { | ||
intervalId: null, | ||
startTime: null, | ||
} | ||
}; | ||
|
||
const sendTick = () => { | ||
const elapsedTime = Date.now() - timerState.startTime | ||
postMessage({ type: 'TICK', time: elapsedTime }) | ||
} | ||
const elapsedTime = Date.now() - timerState.startTime; | ||
postMessage({ type: "TICK", time: elapsedTime }); | ||
}; | ||
|
||
onmessage = (event) => { | ||
const { type, startTime: receivedStartTime } = event.data | ||
const { type, startTime: receivedStartTime } = event.data; | ||
switch (type) { | ||
case 'START': | ||
case "START": | ||
if (timerState.intervalId === null) { | ||
timerState.startTime = receivedStartTime | ||
timerState.intervalId = setInterval(sendTick, 1000) | ||
timerState.startTime = receivedStartTime; | ||
timerState.intervalId = setInterval(sendTick, 1000); | ||
} | ||
break | ||
case 'RESET': | ||
clearInterval(timerState.intervalId) | ||
timerState.intervalId = null | ||
timerState.startTime = null | ||
break | ||
break; | ||
case "RESET": | ||
clearInterval(timerState.intervalId); | ||
timerState.intervalId = null; | ||
timerState.startTime = null; | ||
break; | ||
default: | ||
console.error('Unknown message type:', type) | ||
console.error("Unknown message type:", type); | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters