Fix undefined listItem

This commit is contained in:
Abderahman88 2021-03-03 01:19:18 +01:00
parent 60cd3649bf
commit 3c8f4bf6fd
3 changed files with 6 additions and 4 deletions

View File

@ -35,12 +35,14 @@ This is an application that supports Feedback through a web part that can be use
Solution|Author(s) Solution|Author(s)
--------|--------- --------|---------
react-feedback | Perry Kankam react-feedback | Perry Kankam
react-feedback | Abderahman Moujahid
## Version history ## Version history
Version|Date|Comments Version|Date|Comments
-------|----|-------- -------|----|--------
1.0|December 15, 2020|Initial release 1.0.0|December 15, 2020|Initial release
1.0.1|March 3, 2021|Fix undefined listItem
## Disclaimer ## Disclaimer

View File

@ -3,7 +3,7 @@
"solution": { "solution": {
"name": "feedback-webpart-client-side-solution", "name": "feedback-webpart-client-side-solution",
"id": "d5e255e1-7071-49a8-b50d-b06c80e4ac02", "id": "d5e255e1-7071-49a8-b50d-b06c80e4ac02",
"version": "1.0.0.0", "version": "1.0.1.0",
"includeClientSideAssets": true, "includeClientSideAssets": true,
"isDomainIsolated": false, "isDomainIsolated": false,
"developer": { "developer": {

View File

@ -50,7 +50,7 @@ export default class FeedbackWebPart extends BaseWebPart<IFeedbackWebPartProps>
buttonLabel: escape(this.properties.buttonLabel), buttonLabel: escape(this.properties.buttonLabel),
showCategory: showCategory, showCategory: showCategory,
themeVariant: this.themeVariant, themeVariant: this.themeVariant,
listitemid: this.context.pageContext.listItem.id, //Replace with "1" if you're running this in a workbench listitemid: !!this.context.pageContext.listItem ? this.context.pageContext.listItem.id : null,
selectedCategory: escape(this.properties.feedbackCategory), selectedCategory: escape(this.properties.feedbackCategory),
currentUser: this.context.pageContext.user currentUser: this.context.pageContext.user
} }