Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
240
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-240
240
Commits
5ad75e7c
Commit
5ad75e7c
authored
Feb 07, 2023
by
Malsha Rathnasiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last changes
parent
b4362afa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
22 deletions
+25
-22
DriverApp/api/constants.js
DriverApp/api/constants.js
+1
-1
DriverApp/screens/TabOneScreen.jsx
DriverApp/screens/TabOneScreen.jsx
+13
-10
MobileApp/api/constants.js
MobileApp/api/constants.js
+1
-1
MobileApp/screens/TabOneScreen.jsx
MobileApp/screens/TabOneScreen.jsx
+10
-10
backend/db_old5.sqlite3
backend/db_old5.sqlite3
+0
-0
backend/output.m4a
backend/output.m4a
+0
-0
No files found.
DriverApp/api/constants.js
View file @
5ad75e7c
// export const BACKEND_URL = "http://192.168.8.103:8000"
// export const BACKEND_URL = "http://192.168.8.103:8000"
import
{
Platform
}
from
'
react-native
'
import
{
Platform
}
from
'
react-native
'
export
const
BACKEND_ADDRESS
=
Platform
.
OS
==
'
web
'
?
"
http://127.0.0.1:8000
"
:
"
https://21a1-112-134-220-17
2.ap.ngrok.io
"
export
const
BACKEND_ADDRESS
=
Platform
.
OS
==
'
web
'
?
"
http://127.0.0.1:8000
"
:
"
https://2da0-2401-dd00-10-20-c8ff-e0d9-290b-d73
2.ap.ngrok.io
"
export
const
BACKEND_URL
=
`
${
BACKEND_ADDRESS
}
`
export
const
BACKEND_URL
=
`
${
BACKEND_ADDRESS
}
`
DriverApp/screens/TabOneScreen.jsx
View file @
5ad75e7c
...
@@ -158,18 +158,19 @@ export default function ChatScreen({ navigation }) {
...
@@ -158,18 +158,19 @@ export default function ChatScreen({ navigation }) {
// }
// }
useEffect
(()
=>
{
//
useEffect(() => {
const
interval
=
setInterval
(()
=>
{
//
const interval = setInterval(() => {
if
(
chatDetails
)
{
//
if (chatDetails) {
loadChats
();
//
loadChats();
}
//
}
},
3000
);
//
}, 3000);
return
()
=>
{
//
return () => {
clearInterval
(
interval
);
//
clearInterval(interval);
};
//
};
},
[]);
//
}, []);
const
loadChatDetails
=
async
()
=>
{
const
loadChatDetails
=
async
()
=>
{
console
.
log
(
'
loadchat detials
'
)
await
getList
(
"
users
"
)
await
getList
(
"
users
"
)
.
then
((
res
)
=>
res
.
json
())
.
then
((
res
)
=>
res
.
json
())
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
...
@@ -196,7 +197,9 @@ export default function ChatScreen({ navigation }) {
...
@@ -196,7 +197,9 @@ export default function ChatScreen({ navigation }) {
return
n_res
;
return
n_res
;
}
}
});
});
console
.
log
({
converted
})
setConversations
(
converted
);
setConversations
(
converted
);
// //change from user and to user depending on the current user
// //change from user and to user depending on the current user
// if (res[0].from_user == user_id) {
// if (res[0].from_user == user_id) {
// setChatDetails(res)
// setChatDetails(res)
...
...
MobileApp/api/constants.js
View file @
5ad75e7c
// export const BACKEND_URL = "http://192.168.8.103:8000"
// export const BACKEND_URL = "http://192.168.8.103:8000"
import
{
Platform
}
from
'
react-native
'
import
{
Platform
}
from
'
react-native
'
export
const
BACKEND_ADDRESS
=
Platform
.
OS
==
'
web
'
?
"
http://127.0.0.1:8000
"
:
"
https://
d2e9-112-134-220-172.ap
.ngrok.io
"
export
const
BACKEND_ADDRESS
=
Platform
.
OS
==
'
web
'
?
"
http://127.0.0.1:8000
"
:
"
https://
4369-2401-dd00-10-20-9531-45f3-1d72-774e.in
.ngrok.io
"
export
const
BACKEND_URL
=
`
${
BACKEND_ADDRESS
}
`
export
const
BACKEND_URL
=
`
${
BACKEND_ADDRESS
}
`
MobileApp/screens/TabOneScreen.jsx
View file @
5ad75e7c
...
@@ -162,16 +162,16 @@ export default function ChatScreen({ navigation }) {
...
@@ -162,16 +162,16 @@ export default function ChatScreen({ navigation }) {
// }
// }
useEffect
(()
=>
{
//
useEffect(() => {
const
interval
=
setInterval
(()
=>
{
//
const interval = setInterval(() => {
if
(
chatDetails
)
{
//
if (chatDetails) {
loadChats
();
//
loadChats();
}
//
}
},
3000
);
//
}, 3000);
return
()
=>
{
//
return () => {
clearInterval
(
interval
);
//
clearInterval(interval);
};
//
};
},
[]);
//
}, []);
const
loadChatDetails
=
async
()
=>
{
const
loadChatDetails
=
async
()
=>
{
await
AsyncStorage
.
getItem
(
"
user_id
"
).
then
((
user_id
)
=>
{
await
AsyncStorage
.
getItem
(
"
user_id
"
).
then
((
user_id
)
=>
{
...
...
backend/db_old5.sqlite3
0 → 100644
View file @
5ad75e7c
File added
backend/output.m4a
View file @
5ad75e7c
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment