Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toiletcoin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
atichat
toiletcoin
Commits
3454e080
Commit
3454e080
authored
Aug 06, 2019
by
Chaiwith Santaweesuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2890f86a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
src/Pages/Home.js
+16
-12
No files found.
src/Pages/Home.js
View file @
3454e080
...
...
@@ -134,24 +134,28 @@ class Home extends Component {
getAllDevicesInfo
=
async
()
=>
{
const
{
currentUid
}
=
this
.
state
;
console
.
log
(
"currentUid"
)
console
.
log
(
currentUid
)
const
DevicesId
=
await
db
.
collection
(
'membership'
)
.
doc
(
currentUid
)
.
get
();
//
console.log(Object.keys(DevicesId.data()));
//
const allDevicesId = Object.keys(DevicesId.data());
console
.
log
(
Object
.
keys
(
DevicesId
.
data
()));
const
allDevicesId
=
Object
.
keys
(
DevicesId
.
data
());
// console.log(allDevicesId);
// let allDeviceInfo = [];
// allDevicesId.map(async (deviceId, index) => {
// const deviceInfo = await db
// .collection('device')
// .doc(deviceId)
// .get();
// allDeviceInfo.push(deviceInfo.data());
// });
this
.
setState
({
allDevicesId
:
Object
.
keys
(
DevicesId
.
data
())
});
let
allDeviceInfo
=
[];
for
(
let
i
=
0
,
len
=
allDevicesId
.
length
;
i
<
len
;
i
++
)
{
const
deviceInfo
=
await
db
.
collection
(
'device'
)
.
doc
(
allDevicesId
[
i
])
.
get
();
allDeviceInfo
.
push
(
deviceInfo
.
data
());
if
(
i
==
allDevicesId
.
length
-
1
){
console
.
log
(
allDeviceInfo
)
}
}
// this.setState({ allDevicesId: Object.keys(DevicesId.data()) });
};
getFeedData
=
async
(
deviceId
,
selectedRange
,
breakdown
)
=>
{
...
...
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