When you receive a blessing, what do you value more? The blessing or the giver of that blessing(Jesus). If you find yourself valuing the blessing more than God,then God is not glorified. He is glorified when we value him more than anything. If you always value the giver of the gift, then when a trial is set before you, you will not be discouraged because you will still value him.
James 1:2 -"Count it all joy, my brothers , when you meet trials of various kinds."
He gives us lasting joy when we value him and he is most glorified when we rejoice in him. The thing we rejoice in most is what we value most. If we value anything more than God then we do not have real joy. It is only temporary happiness, we will have it for a little while then it will fade. But when we value God he gives us joy that lasts because it is in him.