-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android notification system #1380
Changes from 4 commits
0e6ae63
7388b4f
26a2b71
a4e1ddb
ee8c152
444ca99
667500e
005adc6
be748d8
f16bfef
e986341
ac7c3bb
9a8a821
cc63b4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
import site | ||
import sys | ||
|
||
# First, drop system-sites related paths. | ||
original_sys_path = sys.path[:] | ||
known_paths = set() | ||
for path in {"/usr/local/lib/python3.12/site-packages"}: | ||
site.addsitedir(path, known_paths=known_paths) | ||
system_paths = set( | ||
os.path.normcase(path) for path in sys.path[len(original_sys_path) :] | ||
) | ||
original_sys_path = [ | ||
path for path in original_sys_path if os.path.normcase(path) not in system_paths | ||
] | ||
sys.path = original_sys_path | ||
|
||
# Second, add lib directories. | ||
# ensuring .pth file are processed. | ||
for path in [ | ||
"/tmp/pip-build-env-wwuhobll/overlay/lib/python3.12/site-packages", | ||
"/tmp/pip-build-env-wwuhobll/normal/lib/python3.12/site-packages", | ||
]: | ||
assert path not in sys.path | ||
site.addsitedir(path) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
git+https://github.com/Reckless-Satoshi/drf-openapi-tester.git@soften-django-requirements (from -r requirements_dev.txt (line 3)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import React, { useContext, useEffect } from 'react'; | ||
import { Routes as DomRoutes, Route, useNavigate } from 'react-router-dom'; | ||
import { Box, Slide, Typography, styled } from '@mui/material'; | ||
import { type UseAppStoreType, AppContext } from '../contexts/AppContext'; | ||
|
||
import { RobotPage, MakerPage, BookPage, OrderPage, SettingsPage } from '.'; | ||
import { GarageContext, UseGarageStoreType } from '../contexts/GarageContext'; | ||
|
||
const Routes: React.FC = () => { | ||
const navigate = useNavigate(); | ||
const { garage } = useContext<UseGarageStoreType>(GarageContext); | ||
const { page, slideDirection } = useContext<UseAppStoreType>(AppContext); | ||
|
||
useEffect(() => { | ||
window.addEventListener('navigateToPage', (event) => { | ||
console.log('navigateToPage', JSON.stringify(event)); | ||
const orderId = event?.detail?.order_id; | ||
const coordinator = event?.detail?.coordinator; | ||
if (orderId && coordinator) { | ||
const slot = garage.getSlotByOrder(coordinator, orderId); | ||
if (slot?.token) { | ||
garage.setCurrentSlot(slot?.token); | ||
navigate(`/order/${coordinator}/${orderId}`); | ||
} | ||
} | ||
}); | ||
}, []); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Necessary to catch navigation requests form the system |
||
|
||
return ( | ||
<DomRoutes> | ||
{['/robot/:token?', '/', ''].map((path, index) => { | ||
return ( | ||
<Route | ||
path={path} | ||
element={ | ||
<Slide | ||
direction={page === 'robot' ? slideDirection.in : slideDirection.out} | ||
in={page === 'robot'} | ||
appear={slideDirection.in !== undefined} | ||
> | ||
<div> | ||
<RobotPage /> | ||
</div> | ||
</Slide> | ||
} | ||
key={index} | ||
/> | ||
); | ||
})} | ||
|
||
<Route | ||
path={'/offers'} | ||
element={ | ||
<Slide | ||
direction={page === 'offers' ? slideDirection.in : slideDirection.out} | ||
in={page === 'offers'} | ||
appear={slideDirection.in !== undefined} | ||
> | ||
<div> | ||
<BookPage /> | ||
</div> | ||
</Slide> | ||
} | ||
/> | ||
|
||
<Route | ||
path='/create' | ||
element={ | ||
<Slide | ||
direction={page === 'create' ? slideDirection.in : slideDirection.out} | ||
in={page === 'create'} | ||
appear={slideDirection.in !== undefined} | ||
> | ||
<div> | ||
<MakerPage /> | ||
</div> | ||
</Slide> | ||
} | ||
/> | ||
|
||
<Route | ||
path='/order/:shortAlias/:orderId' | ||
element={ | ||
<Slide | ||
direction={page === 'order' ? slideDirection.in : slideDirection.out} | ||
in={page === 'order'} | ||
appear={slideDirection.in !== undefined} | ||
> | ||
<div> | ||
<OrderPage /> | ||
</div> | ||
</Slide> | ||
} | ||
/> | ||
|
||
<Route | ||
path='/settings' | ||
element={ | ||
<Slide | ||
direction={page === 'settings' ? slideDirection.in : slideDirection.out} | ||
in={page === 'settings'} | ||
appear={slideDirection.in !== undefined} | ||
> | ||
<div> | ||
<SettingsPage /> | ||
</div> | ||
</Slide> | ||
} | ||
/> | ||
</DomRoutes> | ||
); | ||
}; | ||
|
||
export default Routes; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import { | |
defaultExchange, | ||
} from '.'; | ||
import defaultFederation from '../../static/federation.json'; | ||
import { systemClient } from '../services/System'; | ||
import { getHost } from '../utils'; | ||
import { coordinatorDefaultValues } from './Coordinator.model'; | ||
import { updateExchangeInfo } from './Exchange.model'; | ||
|
@@ -90,9 +91,12 @@ export class Federation { | |
}; | ||
|
||
updateUrl = async (origin: Origin, settings: Settings, hostUrl: string): Promise<void> => { | ||
const federationUrls = {}; | ||
for (const coor of Object.values(this.coordinators)) { | ||
coor.updateUrl(origin, settings, hostUrl); | ||
federationUrls[coor.shortAlias] = coor.url; | ||
} | ||
systemClient.setCookie('federation', JSON.stringify(federationUrls)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Informs the system about current coordinators and their URLs, useful when changing to tesnet and to avoid duplication on the systems' code |
||
}; | ||
|
||
update = async (): Promise<void> => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we might have commited a few files under
api/lightning
that are not part of this PR and possibly shouod be ignored?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why but these files has been extremely persistent on being created, everytine I tried to do a commit they appear probably because after-commit, any clue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed anyways