Skip to content

Commit aea839b

Browse files
committed
Merge branch 'master' into fix-google-rejection
2 parents 4bb9edd + 6c25867 commit aea839b

File tree

10 files changed

+35
-23
lines changed

10 files changed

+35
-23
lines changed

.github/workflows/distribute.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ jobs:
7070
with:
7171
path: '**/node_modules'
7272
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
73+
- name: Set up Node.js
74+
uses: actions/setup-node@v4
75+
with:
76+
node-version: 18
7377
- name: Install yarn dependencies
7478
run: yarn
7579

@@ -78,7 +82,7 @@ jobs:
7882

7983
- name: Upload the package to Chrome web store
8084
if: ${{ github.event.inputs.testMode == 'false' }}
81-
run: npx chrome-webstore-upload-cli@2 upload --source chrome_extension.zip --extension-id $EXTENSION_ID --auto-publish
85+
run: npx chrome-webstore-upload-cli@3 upload --source chrome_extension.zip --extension-id $EXTENSION_ID --auto-publish
8286
env:
8387
EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
8488
CLIENT_ID: ${{secrets.CHROME_EXTENSION_CLIENT_ID}}
@@ -106,10 +110,10 @@ jobs:
106110
run: yarn build:firefox
107111
- name: Upload the package to Firefox web store
108112
if: ${{ github.event.inputs.testMode == 'false' }}
109-
uses: yayuyokitano/firefox-addon@v0.0.6-alpha
113+
uses: wdzeng/firefox-addon@v1
110114
with:
111-
api_key: ${{ secrets.WEB_EXT_API_KEY }}
112-
api_secret: ${{ secrets.WEB_EXT_API_SECRET }}
113-
guid: '{f8793186-e9da-4332-aa1e-dc3d9f7bb04c}'
114-
xpi_path: firefox_extension.zip
115-
src_path: source_code.zip
115+
jwt-issuer: ${{ secrets.WEB_EXT_API_KEY }}
116+
jwt-secret: ${{ secrets.WEB_EXT_API_SECRET }}
117+
addon-guid: '{f8793186-e9da-4332-aa1e-dc3d9f7bb04c}'
118+
xpi-path: firefox_extension.zip
119+
source-file-path: source_code.zip

public/base.manifest.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22
"manifest_version": 3,
33
"name": "Hackertab.dev - developer news",
44
"description": "All developer news in one tab",
5-
"version": "1.23.1",
5+
"version": "1.23.2",
66
"chrome_url_overrides": {
77
"newtab": "index.html"
88
},
9-
"host_permissions": [
10-
"https://*.hackertab.dev/*"
11-
],
9+
"host_permissions": ["https://*.hackertab.dev/*"],
1210
"content_scripts": [
1311
{
14-
"matches": [
15-
"https://hackertab.dev/*"
16-
],
12+
"matches": ["https://hackertab.dev/*"],
1713
"run_at": "document_start",
18-
"js": [
19-
"content.js"
20-
]
14+
"js": ["content.js"]
2115
}
2216
],
2317
"icons": {

public/firefox.manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"background": {
33
"scripts": ["background.js"]
4+
},
5+
"browser_specific_settings": {
6+
"gecko": {
7+
"id": "{f8793186-e9da-4332-aa1e-dc3d9f7bb04c}"
8+
}
49
}
510
}

src/components/Layout/AppLayout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'src/assets/App.css'
66
import { AuthModal, useAuth } from 'src/features/auth'
77
import { usePostStreak } from 'src/features/hits'
88
import { MarketingBanner } from 'src/features/MarketingBanner'
9+
import { identifyUserStreak } from 'src/lib/analytics'
910
import { AuthProvider } from 'src/providers/AuthProvider'
1011
import { Header } from './Header'
1112

@@ -17,6 +18,7 @@ export const AppLayout = () => {
1718
if (isConnected) {
1819
postStreakMutation.mutateAsync(undefined).then((data) => {
1920
setStreak(data.streak)
21+
identifyUserStreak(data.streak)
2022
})
2123
}
2224
}, [isConnected])

src/features/auth/components/AuthModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AuthProvider, GithubAuthProvider, GoogleAuthProvider } from 'firebase/auth'
1+
import { GithubAuthProvider, GoogleAuthProvider } from 'firebase/auth/web-extension'
22
import { useCallback, useState } from 'react'
33
import { FaGithub } from 'react-icons/fa'
44
import { FcGoogle } from 'react-icons/fc'
@@ -18,6 +18,7 @@ type AuthModalProps = {
1818
const googleAuthProvider = new GoogleAuthProvider()
1919
const githubAuthProvider = new GithubAuthProvider()
2020

21+
type AuthProvider = GoogleAuthProvider | GithubAuthProvider
2122
export const AuthModal = ({ showAuth }: AuthModalProps) => {
2223
const { closeAuthModal, authError, setAuthError } = useAuth()
2324
const [selectedProvider, setSelectedProvider] = useState<AuthProvider>(googleAuthProvider)

src/features/auth/hooks/useAuth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { signOut } from 'firebase/auth'
1+
import { signOut } from 'firebase/auth/web-extension'
22
import { AuthModalStore, AuthStore } from 'src/features/auth'
33
import { trackUserDisconnect } from 'src/lib/analytics'
44
import { firebaseAuth } from 'src/lib/firebase'

src/lib/analytics.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export enum Attributes {
7373
DURATION = 'Duration',
7474
PROVIDER = 'Provider',
7575
ADV = 'ADV',
76+
STREAK = 'Streak',
7677
}
7778

7879
const _SEP_ = ' '
@@ -434,7 +435,9 @@ export const identifyUserMaxVisibleCards = (maxVisibleCards: number) => {
434435
export const identifyAdvBlocked = (blocked: boolean) => {
435436
identifyUserProperty(Attributes.ADV, blocked)
436437
}
437-
438+
export const identifyUserStreak = (value: number) => {
439+
identifyUserProperty(Attributes.STREAK, value)
440+
}
438441
// Private functions
439442
type trackEventProps = {
440443
object: Exclude<Objects, null | undefined>

src/lib/firebase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { initializeApp } from 'firebase/app'
2-
import { getAuth } from 'firebase/auth'
2+
import { getAuth } from 'firebase/auth/web-extension'
33
import { FIREBASE_API_KEY } from 'src/config'
44

55
const firebaseConfig = {

src/lib/interceptors/DefaultRequestInterceptor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,5 @@ const getUserToken = async () => {
3232
}
3333
unsub()
3434
})
35-
resolve('abc')
3635
})
3736
}

src/providers/AuthProvider.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { GithubAuthProvider, GoogleAuthProvider, signInWithCredential } from 'firebase/auth'
1+
import {
2+
GithubAuthProvider,
3+
GoogleAuthProvider,
4+
signInWithCredential,
5+
} from 'firebase/auth/web-extension'
26
import { useCallback, useEffect } from 'react'
37
import { useNavigate, useSearchParams } from 'react-router-dom'
48
import toast from 'react-simple-toasts'

0 commit comments

Comments
 (0)